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. 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

Popular posts from this blog

Parse XML to dynamic object in C#

C# Updating GUI from different thread