Feb 1, 2023
Per Djurner

Search stored procedures in SQL Server

Just posting a handy query for searching through all stored procedures in MS SQL Server.

DECLARE @search NVARCHAR(100) = 'text to search for';
SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_DEFINITION LIKE '%' + @search + '%'

Home