How to find matching stored procedures containing a text in MS SQL Server
SkillBakery Studio
Learn how to find matching stored procedures based on a given search term
SELECT DISTINCT name FROM syscomments WHERE text LIKE '%your_search_text%' AND OBJECTPROPERTY(id, 'IsProcedure') = 1 ORDER BY name; Replace your_search_tex with the text you want to search for.
This query searches the system table syscomments for stored procedures that contain the search text. The DISTINCT keyword ensures that each stored procedure is only listed once, even if it contains multiple occurrences of the search text. The OBJECTPROPERTY function filters the results to only include procedures, and the ORDER BY clause sorts the results by name.
Note that this method searches the definition of stored procedures, so it may not find procedures that dynamically generate SQL code. ... https://www.youtube.com/watch?v=K_ykW73lOtQ
5161494 Bytes