Click to See Complete Forum and Search --> : compile an sql query/script
DanielaTm
June 7th, 2006, 02:10 AM
Hi,
I am making an script generator application in c# and I want to compile the generated script, not execute.
Does someone know how to do it? to call compile function of sql server?
Thanks,
exterminator
June 7th, 2006, 06:09 AM
I guess you can do this with the SET NOEXEC ON option. Have a look at this - SET NOEXEC (http://msdn2.microsoft.com/en-us/library/ms188394.aspx)
Alternatively, I guess you can also use the SHOWPLAN to get the plan for the built script containing the query. If the queries are correctly prepared - it should show the info or else should fail - I am not sure what error messages will this throw up. But I would not advise on this. See if NOEXEC helps.
DanielaTm
June 7th, 2006, 10:04 AM
Hi
Thank you! It is exactly what I wanted!
exterminator
June 7th, 2006, 10:49 AM
Hi
Thank you! It is exactly what I wanted!You're welcome, Daniela. :)
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.