Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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.

 

Vaccano

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

Objects are without statistics!!!

Objects are without statistics!!!

BLOG

SQL Server – sp_help without arguments.

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

FORUM

Restore without Checkdb

Restore without Checkdb

ARTICLE

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...

FORUM

Is there a way to find objects that do not compile

How can i pinpoint uncompilable objects without running it

Tags
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones