August 21, 2006 at 4:39 pm
Hi, can anyone tell me how I can find invalid views and procedures in my database? (SQL2K)
I know there are some, but need to find them before the yusers do.
thanks
August 21, 2006 at 7:55 pm
August 24, 2006 at 6:35 pm
yes, sorry, that's exactly what I mean.
I know I have one, definetly, but would like some sort of script to check all procedures and views.
August 24, 2006 at 6:49 pm
Sounds complicated to me as you would need to parse the source for the procedures or views to determine column and table names.
Once you have a list of those, you could then check for their existence in sysobjects or syscolumns.
You should probably include calls to other stored procedures as well.
It's the parsing of the source that will be the difficult part.
Not something I've done, but that would be my initial approach.
August 24, 2006 at 6:50 pm
Oops, forgot to mention that sp_helptext is the stored proc for getting the source of your views and procedures.
You might want to include User defined functions as well incase they reference something that is no there
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply