Skip to content

Instantly share code, notes, and snippets.

@gyuwon
Last active December 28, 2015 18:39
Show Gist options
  • Save gyuwon/7544261 to your computer and use it in GitHub Desktop.
Save gyuwon/7544261 to your computer and use it in GitHub Desktop.
Search stored procedures which have the specified text in MS SQL Server
SELECT DISTINCT 'sp_helptext ' + b.name
FROM syscomments a WITH (NOLOCK)
JOIN sysobjects b WITH (NOLOCK) ON a.id=b.id
WHERE
a.text LIKE '%[some text]%' AND
b.xtype='p'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment