Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Non-printable characters in SQL Scripts out of SSMS? Expand / Collapse
Author
Message
Posted Friday, September 4, 2009 7:30 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Wednesday, December 14, 2011 12:03 PM
Points: 613, 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?




I reject your reality and substitute one of my own. - Adam Savage-Mythbuster
Post #782888
Posted Friday, September 4, 2009 7:42 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, October 9, 2014 1:02 PM
Points: 6,032, Visits: 5,284
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
Post #782900
Posted Friday, September 4, 2009 9:05 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:26 AM
Points: 14,205, Visits: 28,536
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
Post #782999
Posted Friday, September 4, 2009 9:29 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Wednesday, December 14, 2011 12:03 PM
Points: 613, 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
Post #783012
Posted Friday, September 4, 2009 9:36 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:26 AM
Points: 14,205, Visits: 28,536
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
Post #783022
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse