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%'

Comments

  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

    ReplyDelete

Post a Comment

Popular posts from this blog

Tibco Rendezvous (tibrv) C# .Net example

Parse XML to dynamic object in C#