August 11 2008

Finding all references to an object in SQL Server

The problem:  You want to change a parameter in a stored procedure or function, but you don’t know what other database methods are referencing it.

This SQL statement will show you all references, so you can be confident you’ve changed all references:

SELECT object_name(id), *
FROM syscomments
WHERE text LIKE '%SearchPhrase%'
Comments (View)
blog comments powered by Disqus

Please...

Leave a comment if this has helped or offended you.

StackOverflow Id