I have to work on a database in which there are many stored-procedures & views that are referencing non-existing tables & columns. How can I get the list of invalid objects (Tables, Columns) so I can fix it accordingly?
-
1You can use SQL Server Data Tools for this.Martin Smith– Martin Smith2012-06-20 09:03:49 +00:00Commented Jun 20, 2012 at 9:03
-
Thanks, SQL Prompt worked for me.Yaqub Ahmad– Yaqub Ahmad2012-06-20 09:05:05 +00:00Commented Jun 20, 2012 at 9:05
-
1Until the evaluation runs out!Martin Smith– Martin Smith2012-06-20 09:05:33 +00:00Commented Jun 20, 2012 at 9:05
-
+1 for great advice. Let me try it.Yaqub Ahmad– Yaqub Ahmad2012-06-20 09:18:01 +00:00Commented Jun 20, 2012 at 9:18
Add a comment
|
1 Answer
You could use SQL Prompt from Red Gate. It has a Find Invalid Objects feature that identifies stored procedures and views (amongst others) that refer to non-existent objects and tells you why.
SQL Prompt is a commercial product -- you could use its 14-day fully-functional free trial period to tidy up your database right away though.
Disclaimer: I work for Red Gate (on the SQL Prompt team).