How to find Invalid column references

  • It used to be in SQL 6.5 that a stored proc would not compile if you referenced a column (or Table) that isn't there.  You could usually blame a typo.  But sometimes it was columns or tables being dropped or renamed.

    SQL 2000 no longer does this.  It compiles your procs quite happily.  SQL 2000 doesn't complain until you run the proc with just the right parameters.

    My database has been around 3 or 4 years and I am willing to bet there is now a proc here or there that has gone invalid.  You can be sure these would be in the 'seldom used' category.

    My question: Is there any way to find these invalid procs, without running each proc one by one with every conceivable combination of parameters?

     

  • Run SQL Server Profiler for a period of time to capature the stored procedurs which have been used and use the list as filter to find out which stored procedures never be run and go from there.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply