13
Jan
2023
2023
How to find all procedures having table reference in Sql server
by Shubham Batra
58
SQL
So, in sql server we often have to find table reference in all procedures. So for that purpose we can use following query.
SELECT Name FROM sys.procedures WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%tblblogs%'
This query will return us all the procedures where we have used tblblogs anywhere in these procedures. You can have a look at following image where we have found all procedure where specified table was use
So you can modify your table name accordingly and fetch out the correct results. This is how to find all procedures having table reference in Sql server.