Geeks With Blogs
AngelEyes on .Net Tips, tricks and WTFs about Asp .Net, SQL Server and the likes.

In this example, I searched for any SP containing the text LoadByIP:


 

SELECT Distinct SO.Name

FROM sysobjects SO (NOLOCK)

INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID

AND SO.Type = 'P'

AND SC.Text LIKE '%LoadByIP%'

ORDER BY SO.Name

 

 

Update: this was suggested by nts (see comments):

 

SELECT routine_name, routine_definition

FROM information_schema.routines

WHERE routine_definition LIKE '%LoadByIP%'

AND routine_type = 'PROCEDURE'

Both work well :-)

Posted on Wednesday, September 16, 2009 2:32 PM | Back to top


Comments on this post: SQL Server , How to search for text in Stored Procedures

# re: SQL Server , How to search for text in Stored Procedures
Requesting Gravatar...
nice will test this later, i use :- SELECT routine_name, routine_definition
FROM information_schema.routines
WHERE routine_definition LIKE '%textyoursearchingfor%'
AND routine_type = 'PROCEDURE'
Left by nts on Sep 18, 2009 1:03 PM

# To:nts
Requesting Gravatar...
Nice, I like it. I'm going to add it to this post :-)
Left by Angel Eyes on Sep 21, 2009 8:01 AM

# re: SQL Server , How to search for text in Stored Procedures
Requesting Gravatar...
For developpers: option to fully clear the cache before every page-request
- Option for disabling cookie from not visited domains (like safari)
- Option for disabling resizing of the current window for scripts. Definetly no web app need 1920x1200.
- Sometime there is the case

http://www.bighaber.com
Left by haber on Dec 15, 2010 2:08 PM

Comments have been closed on this topic.
Copyright © AngelEyes | Powered by: GeeksWithBlogs.net | Join free