Finding all Stored Procedures which use Table name and Column name of the same table

N_Sri
N_Sri used Ask the Experts™
on
Hi,
 
Think that there is table (  Employee  ) with Fields  Name(Varchar), Active(Smallint),LastName(Varchar).
 
So this table is being used  in many Stored procedures. Now I wanted to find all Stored procedures which use table  Employee and use Active(Smallint)  in the Stored Procedure  code...
 
Please  help me to  have such query to find the list of stored procedures....  I found some query  by useing Text search... but it was not getting correct data.
 
litte urgent .. :(
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ephraim WangoyaSoftware Engineer
Commented:

select object_name(id) as 'Stored Procedure'
from syscomments sc
inner join sys.objects so
on sc.id = so.object_id
where so.type = 'P'
and (text like '%Employee%')
and (text like '%Active%')

You need to give feedback so that the experts can better help you
Commented:
@ewangoya :  your query is not  getting correct data.

Author

Commented:
thankyou

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial