SQL Server 2005 - Find Which Stored Procs Run To A Particular Table

后端 未结 2 498
心在旅途
心在旅途 2021-01-14 00:20
  • Is there a quick way that I can find which stored procedures run to a particular table in my database?
  • The database is very large with lots of tables and SPRO
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-14 01:00

    A Combination of looking at dependencies and looking at the text of your objects should do it.

    select * from sys.sql_modules
    where 
    definition like '%tableName%'
    /*AND objectproperty(object_id,'isprocedure')=1 to just look at procedures*/
    
    exec sp_depends 'tableName'
    

提交回复
热议问题