Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 The mystery of the dissapearing character

Author  Topic 

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2012-01-27 : 04:41:54
I'm in the process of migrating a small handful of databases from SQL 2000 to 2008. As part of this we want to make some changes so I have it all in a script.

When I sent the script off everything appeared to go smoothly. OF course this was all an illusion. The databases have a couple of logins, both SQL and Windows. The windows ones work as expected but the SQL ones don't.

In SSMS I tried to setup a connection to the database using one of the SQL Logins. This gives me a login failed error, State 8 which I believe is telling me I used the wrong password. Just to make sure I was using the right password I copied and pasted it from my script but the same happened.

Just for reference the script for the SQL logins is all of the form

CREATE LOGIN [MyUser] WITH PASSWORD=N'MyPassword', 
DEFAULT_DATABASE=[MyDB],
CHECK_EXPIRATION=OFF,
CHECK_POLICY=OFF


When I spoke to the guy who ran the script he said that there was a spurious character at the end of the password for each of the SQL Logins - he said it was the square symbol but I am thinking that this just means it was some arbitrary character.

OK the mystery has deepened now, while writing this I thought maybe it was the LF/CR at the end of the line that was causing the problem, so was going to put the create login onto one line and ask for that to be run. I pasted the script exactly as above into the email and lo and behold the spurious character appeared and it appeared between the d and the '

i.e.
CREATE LOGIN [SOAUser] WITH PASSWORD=N'SOAUserAccess_004<char appears here>', 
DEFAULT_DATABASE=[AFLookup],
CHECK_EXPIRATION=OFF,
CHECK_POLICY=OFF


I tried to copy and paste it into this message but it doesn't show. My first thought was that this was some sort of font problem (I use Consolas in SSMS) but then I remembered an earlier script that ran without this problem.

So basically I am still looking into what caused this but thought someone here may have come across it, and I have never had an issue before.

Any and all suggestions would be welcome

regards

steve

-----------

What color do you want that database?

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2012-01-27 : 04:53:40
OK I have a bit more information now, it has an ASCII value of 30, just need to figure out where it's coming from now, strange that it appeared as the last character of all the SQL logins


steve

-----------

What color do you want that database?
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2012-01-27 : 05:11:27
Well I have looked through the file history and realised/remembered that I simply copied and pasted to create all the SQL Logins which would explain how it appears in the same place in each of them, just not why or how it got there.

Steve

-----------

What color do you want that database?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2012-03-20 : 02:06:06
quote:
Originally posted by elwoos

Well I have looked through the file history and realised/remembered that I simply copied and pasted to create all the SQL Logins which would explain how it appears in the same place in each of them, just not why or how it got there.

Steve

-----------

What color do you want that database?



If you copy data from EXCEL/WORD, you may have this problem. I too had this problem when working in MySQL

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2012-03-21 : 06:07:32
Hi Madhi

I'm pretty sure I didn't use any of the office tools, which is what makes it even more strange. Never got to the bottom of this but at least I know what to look for now and if it happens to anyone else they may come across this thread

steve

-----------

If you can't spot the sucker, its you.
Go to Top of Page
   

- Advertisement -