Sql Server : Finding all the Stored procedures on some condition

N_Sri
N_Sri used Ask the Experts™
on
Hi ,
Please help me to write this query.
Query  which takes  Table name as parameter AND Column name as parameter ,and finds all the Stored Procedures in my database
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Select *
From    INFORMATION_SCHEMA.ROUTINES
Where   Routine_Type = 'Procedure' and
        Routine_Definition Like '%TableName%'
Ephraim WangoyaSoftware Engineer

Commented:
You have multiple questions similar to this one
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 '%TableName%')    --your table name
and (text like '%ColumnName%')    --your column name

Open in new window

Alpesh PatelSolution Architect at TCS (SAFe®Agilist, TOGAF® Foundation, PSM I®, MCP, MCSD)
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 Contains('TableName')    --your table name
and (text Contains('ColumnName')    --your column name

Author

Commented:
thankyu

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