question

Fatherjack avatar image
Fatherjack asked

Scrambled T-SQL in SSMS

So, I have been working on some code all morning, saving as I went, and I left my desk for a lunch break. No transactions were open, I have no encryption ANYWHERE in the domain, noone used my PC and when I get back I have this: ![alt text][1] [1]: /upfiles/Scrambled_SSMS.png Similar effect on all tabs. I have closed and opened tabs and they stay the same. I have copied text out of the editor into Notepad and it pastes in plain text. Pasting this back in though, and it goes all scrambled again. Does anyone have any ideas what has happened to me and how I can get out of this situation please?
t-sqlssmsencryption
13 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Oleg avatar image Oleg commented ·
@Fatherjack Well, at least you know that **6(/(&7** means select, that is for sure :)
1 Like 1 ·
Oleg avatar image Oleg commented ·
@Fatherjack Seriously, I just ran some tests and it appears that the problem is that every character in your scripts got shifted to the left by 61 (decimal), so letter **s** (ascii 115) became **6** (ascii 54) , letter **e** (ascii 101) became **(** (ascii 40) etc. That info could be useful to RedGate.
1 Like 1 ·
Oleg avatar image Oleg commented ·
@Fatherjack So for now if you need to salvage everything that you have, all you need to do is copy the text from each window into varchar(max) variable and add 61 to each letter's code. At least this way you will have all your queries quickly restored while the problem is being sorted out.
1 Like 1 ·
Cyborg avatar image Cyborg commented ·
installed any SQL 3rd party tools?
0 Likes 0 ·
Fatherjack avatar image Fatherjack ♦♦ commented ·
yes. RedGate SQL Toolbelt
0 Likes 0 ·
Show more comments

1 Answer

·
chrisspowell avatar image
chrisspowell answered
Have you verified the collation? In SQL Server 2008 you can specify a default collation for each new database you create.
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Fatherjack avatar image Fatherjack ♦♦ commented ·
heh, no its not collation. This happen in the SSMS editor window while I was at lunch. The screen shot there is actually TSQL that has for some reason and by some process been mangled by the editor. It hasnt happened since so is, at this point in time, wholly unexplained. A reboot fixed it.
0 Likes 0 ·
Matt Whitfield avatar image Matt Whitfield ♦♦ commented ·
@Fatherjack - I didn't realise you worked for the armed forces!! I saw that advert on the telly where the 'tech' fixed the computer by turning it off and back on again. I cringed and went a bit wrinkly...
0 Likes 0 ·
Fatherjack avatar image Fatherjack ♦♦ commented ·
@Matt - not seen that advert, sounds classy though.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.