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?
Asked
Active
Viewed 1,986 times
1
-
1You can use [SQL Server Data Tools](http://msdn.microsoft.com/en-us/data/tools.aspx) for this. – Martin Smith Jun 20 '12 at 09:03
-
Thanks, SQL Prompt worked for me. – Yaqub Ahmad Jun 20 '12 at 09:05
-
1Until the evaluation runs out! – Martin Smith Jun 20 '12 at 09:05
-
+1 for great advice. Let me try it. – Yaqub Ahmad Jun 20 '12 at 09:18
1 Answers
3
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).

Paul Stephenson
- 67,682
- 9
- 49
- 51