Find all store procedure related to table in SQL Server



Problem: Sometimes, we need to find procedures where a particular table has been used.
Solution: The following query may help you to find all the procedures in which a particular table exists. It may also be used to find text use in procedures.
SELECT DISTINCT a.name,b.text,a.crdate
FROM sys.syscomments b
INNER JOIN sys.sysobjects a ON b.id=a.id
WHERE b.TEXT LIKE '%tblName%
Note: sc.text return all the text of the stored procedure.

Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...