Sunday, 19 January 2014

SQL Server Get List of Stored Procedures Where a Table Name is Used

Here I will explain SQL Server query to get a list of stored procedures where table is used or SQL query to get list of procedures which contains table name in SQL Server.

Description:

In previous posts I explained can function return multiple values in SQL ServerDifference between view & stored procedure in SQLupdate multiple tables using inner join in SQL Server many articles relating toSQL Server, asp.net, IIS, etc. Now I will explain how to get list procedures which contains particular table in SQL Server.  

If we want to get list procedures which contains particular table name we need to write the query like as shown below


SELECT Name FROM sys.procedures WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%YourTableName%'
Example Query


SELECT Name FROM sys.procedures WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%UserInformation%'
Once we run above query we will get output like as shown below

Output

Name

searchUserDetails

No comments:

Post a Comment

Note: only a member of this blog may post a comment.