July 2, 2008 at 3:40 pm
Is there a way to check syntax of all the store procs in a DB at once.
I just need a list of store procs which has systax errors. if there is no way then i have to parse each proc and see if i get
Command(s) completed successfully. messsge.
i know, am going crazy but still looking for some magic where i get list of procs with 1 click.
July 2, 2008 at 11:49 pm
Hi Mike,
How can you compiled a Stored Procedure if it has had an error?
As per my knowledge you cannot create a Stored Procedure if it has an error (Except Dynamic SQL String).
March 26, 2009 at 5:38 pm
I saw this post as I was looking for a solution to do just this.
Sprocs can get out of date when the tables they use are changed after the sproc has been written.
I put together a script that will return the first error message from most scriptable objects in a database.
I have posted it here on SQL Server Centeral. Here is the link:
http://www.sqlservercentral.com/scripts/Syntax+Check/66363/
It only works for SQL Server 2005 and SQL Server 2005. If you were really ambitious you could probably get it to work with SQL Server 2000, but some of the core stuff it uses is missing, so it was more work than I was willing to do.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply