Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL
Expertise: Intermediate
Aug 10, 2017

Search for Text Inside All the SQL Procedures in Your Database

It can become quite frustrating when you cannot remember the name of an SQL stored procedure, especially if you have quite a few of them. But, let's say that you can remember some text inside the stored procedure in question, but not its name. You can use the following SQL to find all Stored Procedures containing the specified text:

SELECT DISTINCT 
	objects.name, 
	objects.type_desc
FROM sys.sql_modules modules

	INNER JOIN sys.objects objects
ON modules.object_id = objects.object_id
	WHERE modules.definition Like '%text_to_search%'
Hannes du Preez
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date