devxlogo

Tip: Search for Text Inside All Your SQL Procedures

Tip: Search for Text Inside All Your SQL Procedures

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_descFROM sys.sql_modules modules	INNER JOIN sys.objects objectsON modules.object_id = objects.object_id	WHERE modules.definition Like '%text_to_search%'

?

Visit the DevX Tip Bank

?

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist