Tuesday, 1 February 2011

SQL Server How to find if any stored procedure is referencing database object

select StoredProcedureName = p.name
from sys.sql_modules sm
inner join
sys.procedures p
on sm.[object_id] = p.[object_id]
where [definition] like '%Database_Object_Name%'

1 comment:

Tales of a Starbucks Addict said...

If you are using the SQL Server Management studio you can also right click on the table and view dependencies.

Great blog by the way

Post a Comment