x

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

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?
more ▼

asked Sep 15 '10 at 05:29 AM in Default

Fatherjack gravatar image

Fatherjack ♦♦
41.3k 73 77 107

installed any SQL 3rd party tools?
Sep 15 '10 at 05:47 AM Cyborg
yes. RedGate SQL Toolbelt
Sep 15 '10 at 05:52 AM Fatherjack ♦♦
@Fatherjack Well, at least you know that 6(/(&7 means select, that is for sure :)
Sep 15 '10 at 07:44 AM Oleg
@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.
Sep 15 '10 at 07:48 AM Oleg
@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.
Sep 15 '10 at 07:51 AM Oleg
(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first
Have you verified the collation? In SQL Server 2008 you can specify a default collation for each new database you create.
more ▼

answered Sep 21 '10 at 02:24 PM

chrisspowell gravatar image

chrisspowell
11

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.
Sep 22 '10 at 01:31 AM Fatherjack ♦♦
@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...
Sep 22 '10 at 01:39 AM Matt Whitfield ♦♦
@Matt - not seen that advert, sounds classy though.
Sep 22 '10 at 01:41 AM Fatherjack ♦♦
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x977
x123
x37

asked: Sep 15 '10 at 05:29 AM

Seen: 1281 times

Last Updated: Sep 15 '10 at 05:29 AM