Data Haunting

Easy Solutions Destination

By

How to find table which is used in many stored procedures

Sometimes in sql server when we change in table column or schema it is very hard or difficult to find that given table is used in how many procedure because  some time it is necessary to find and make changes in most of stored procedure related to that particular table . So i find easiest way to find all stored procedure  by using following Sql query  in Sql Server 2012.

  • Find all stored procedure which is using given table using Sql Query in Sql Server 2012

Here @StringToSearch is your table name which you want to find in all stored procedure .

My advice that make one stored procedure using above sql query so which can help a lot once it is created as stored procedure .

  • Create Stored Procedure to find all stored procedure which is using given table  in Sql Server 2012

 

Here pass parameter as tbl_GivenTable which you want to find

so this will help a lot when you change in schema of table for make instant change to all stored procedure.

2 Responses to How to find table which is used in many stored procedures

  1. thandar says:

    although i run that script, it is not OK.
    Do you have any idea

Leave a Reply