SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Check Syntax on a Database

By Stephen Schaff,

This script gets a list of objects on the current database. It then iterates through them and prints any syntax errors found.


This is useful to find sprocs and other DB Objects that are broken because tables or columns have been dropped or renamed.


It is also useful when restoring a backed-up database to a new server to make sure that the objects still work (ie linked servers are present).


The last use (and the reason it was made) is to find errors in a db that was moved from SQL 2000 to SQL 2008.


It will also find objects where the script name differs from the catalog name.

Free to use for your own code or in any product that is not sold. All other uses (selling this code as part of tool for example) are prohibited without written permission from the author.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



Total article views: 885 | Views in the last 30 days: 1
Related Articles

Objects are without statistics!!!

Objects are without statistics!!!


SQL Server – sp_help without arguments.

sp_help returns information about database objects and types. @object_name argument is optional for...


Restore without Checkdb

Restore without Checkdb


Why Object Databases will always be Tomorrow's Technology

For many years now we always seem to have been on the verge of the revolution in object databases, w...


Is there a way to find objects that do not compile

How can i pinpoint uncompilable objects without running it