Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search Through Stored Procedure

Status
Not open for further replies.

marksmithy69

Programmer
Apr 20, 2001
60
0
0
CA
I am a total newbie to SQL Server, so I apologize for the simple question. Is there a way to search through all stored procedures for a text string? Thanks a lot.
 
Code:
select text from syscomments where text like '%some string%'
 
I use the following query to search for all stored procedures in a db that contain a certain string:

Code:
SELECT ROUTINE_NAME, ROUTINE_DEFINITION 
    FROM INFORMATION_SCHEMA.ROUTINES 
    WHERE ROUTINE_DEFINITION LIKE 'your search string here' 
    AND ROUTINE_TYPE='PROCEDURE'

Thanks,
Jamie
 
Thanks a lot guys. Both examples worked great. I appreciate your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top