Find all references to an object in an SQL Server database

后端 未结 10 1704
深忆病人
深忆病人 2020-12-13 10:02

I\'m trying to find all references to an object in an SQL Server database.

How can I quickly search? SQL Server Management Studio does not seem to do it. I use http:

10条回答
  •  -上瘾入骨i
    2020-12-13 10:47

    I use this query to look for all tables (or text) in the stored procedures:

    SELECT DISTINCT o.name, o.xtype
    FROM syscomments c
    INNER JOIN sysobjects o ON c.id=o.id
    WHERE c.TEXT LIKE '%tablename%'
    

提交回复
热议问题