This blog explains how to retrieve a list of all stored procedures related to tables or a database.
Query:
- SELECT DISTINCT o.name AS StoredProcedure_Name
-
- FROM syscomments c
-
- INNER JOIN sysobjects o ON c.id=o.id
-
- WHERE xtype='P'
Output:
List of all stored Procedure related to a table:
Query:
- SELECT DISTINCT o.name AS StoredProcedure_Name
-
- FROM syscomments c
-
- INNER JOIN sysobjects o ON c.id=o.id
-
- WHERE xtype='P' AND c.TEXT LIKE '%TblCompany_General_Info%'
Output: