SQL Server Gems

Thursday, February 16, 2006

Searching for the content of stored procedures

Someone was asking me how to search for the text contained within a stored procedure. The key lies in querying the INFORMATION_SCHEMA.ROUTINES or syscomments.

Check out some of the solutions below:

1) http://www.aspfaq.com/show.asp?id=2037

2) http://vyaskn.tripod.com/
sql_server_search_stored_procedure_code.htm


3) http://wiki.ittoolbox.com/index.php/
HOWTO:Search_the_text_of_triggers_and_stored_procedures


An imnportant point noted by (1) is that if the text within the stored procedure is greater than 8KB, it might be found in multiple rows, and you would need a way to relate these rows together. (1) shows you an example how you can do that.

0 Comments:

Post a Comment

<< Home