SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Non-printable characters in SQL Scripts out of SSMS?


Non-printable characters in SQL Scripts out of SSMS?

Author
Message
rschaeferhig
rschaeferhig
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1869 Visits: 119
We're seeing wierd things in SSMS using the "Script as Create" function. For example using this capability on a Stored Procedure resulted in:


-- Calculate net revenue
ACK SET @NetResult=@FiscalYear-@PriorFiscalYear



Where "ACK" is actually the ASCII x06 character.

Any idea where these are coming from?w00t



I reject your reality and substitute one of my own. - Adam Savage-Mythbuster
Elliott Whitlow
Elliott Whitlow
SSC-Insane
SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)

Group: General Forum Members
Points: 23666 Visits: 5314
I would guess they were in the original script that created it. You could interogate syscomments and see if it is in the system table (ok view) and I suspect it is. If it is then I would wager heavily on it being in the original script.

CEWII
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)

Group: General Forum Members
Points: 97341 Visits: 33013
Hmmm... No. I haven't seen that one. Is it possible that there's a difference in the server or database collation? That might lead to something like this.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
rschaeferhig
rschaeferhig
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1869 Visits: 119
The procedure was originally developed by hand in SSMS (New Stored Procedure). I don't think the developer typed in a hex 06 while he was typing the code...

The developer "corrected" the function so now the character is not there. We're going to restore the db and look at information_schema.routines to see if it shows up in the text. That will tell us whether its in the actual definition of the procedure or if its an artifact of the scripting process...

More to follow.



I reject your reality and substitute one of my own. - Adam Savage-Mythbuster
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)SSC Guru (97K reputation)

Group: General Forum Members
Points: 97341 Visits: 33013
Ah, you know what it might be? One guy in my office (and he's the only one for some reason), has a lot problems with files getting saved with the wrong encoding. Happens to him all the time (again, he's the only one), but when he saves a file with some messed up code page and then runs it against the server, we get odd, really odd, characters in the code running on the machine. Usually it results in compile time errors when he tries to run the code, but ocassionally stuff slips through.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search