Engineering scalable systems, cloud-native applications, and AI-powered solutions.

How to find Stored Procedures containing specific text in SQL Server?

Below small query will list all the procedures that contains specific text.

Ankush Jain

Ankush Jain

Lead Software Engineer (VP) | Software Architect

Published Sep 27, 2018Updated Nov 24, 2026

Below small query will list all the procedures that contains specific text.

sql
SELECT OBJECT_NAME(object_id), definition
FROM sys.sql_modules
WHERE OBJECTPROPERTY(object_id, 'IsProcedure') = 1
AND definition LIKE '%SearchText%'

Have feedback or thoughts?

Discuss this article or share it on Twitter / GitHub.