Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLSTATE tacked onto output

Status
Not open for further replies.

sbphelps

MIS
Aug 25, 2003
4
US
I have been working on some stored procedures which create SQL scripts. I build the statement, then print it, creating a report which holds the script. My problem is that on each printed line, SQL adds a "SQLSTATE".
For example,
exec sp_configure 'show advanced options', '1' [SQLSTATE 01000]
reconfigure [SQLSTATE 01000]
go [SQLSTATE 01000]

I can get rid of this by loading the statements into a temp table, then selecting from the table, rather than printing. But that seems rather inelegant. Is there a way that I can continue to use Print, and get rid of the SQLSTATE?

Oh, also, I tried simply adding '--' comment characters at the end of the line ( go -- [SQLSTATE...] ), but in the example, I get an error. It seems the combination of the reconfigure, go, and comments don't work together.
SBPhelps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top