Problem : - During project development I got the requirement that I have to modified the column name of the table which is used in the no of procedure i.e i have to found all procedure related to that table and modify it
For the above problem following are the solution that i used
First :
I follow the following step to get list of stored procedure in sql server 2005 management studio
Right click on Table name >> View dependencies
Which list all the procedure and table related to it
Second
Shortest way which list out all procedure related to table
select
so.name,
sc.text
from
sysobjects so
inner join syscomments sc on so.id = sc.id
where
sc.text like '%ROLES%'
and sc.text like '%select%'
Advantage of this :
By the above query i can list out only those stored procedure which is contain select * table name
if i have to list stored procedure which contain update table name than i just have to change my filter condition
The above query is very useful when your table field name get change you have to modify the all stored procedure which is using it