Search all user stored procedures for a specific pattern

by Miro 7. August 2008 03:13

The following script returns the contents of the stored procedures which contain the specific pattern:

SELECT OBJECT_NAME(id), [text]
FROM syscomments
WHERE [text] LIKE '%my pattern%'
AND OBJECTPROPERTY(id, 'IsProcedure') = 1

Tags:

SQL Server

Powered by BlogEngine.NET
Contents copyright 2008 Mirocle Pty. Ltd. All Rights Reserved.