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!

Parse SQL query within stored procedure

Status
Not open for further replies.

diddydustin

Programmer
Jul 30, 2002
181
US
Hey guys,

I need to parse a SQL query within a stored procedure to check the syntax and see if it is a valid query. If it isn't, the error will go in an OUTPUT variable. However, I'm having trouble parsing a string within the stored procedure because SET PARSEONLY ON isn't work. It tells me that I can't set it within a stored procedure, and further inspection into MSDN's website reflects this.

Does anyone know a method to parse a string, not execute it, so that I can see if it's valid and return a result?

Thanks
Dustin
 
Dyanmic SQL Will probably do the trick for you.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(Not quite so old any more.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top