Here are the code could help to find all stored procedures(SP) related to specific table.
#1. SELECT DISTINCT so.name FROM syscomments sc INNER JOIN sysobjects so ON sc.id=so.id WHERE sc.TEXT LIKE '%tablename%'
#2. SELECT DISTINCT o.name, o.xtype FROM syscomments c INNER JOIN sysobjects o ON c.id=o.id WHERE c.TEXT LIKE '%tablename%'
반응형
'SQLServer' 카테고리의 다른 글
SQL Server TSQL - Take a database offline and online (0) | 2019.03.03 |
---|---|
How to set up AlwaysOn Availability Group in SQL Server 2016 (0) | 2019.03.03 |
[SQL] Find all tables size in database - SQL Server (0) | 2019.03.02 |
[SQL] Index fragmentation check - SQL Server (0) | 2018.11.27 |
[SQL] Search foreign key relationships and constraint names for each table - SQL Server (0) | 2018.06.17 |