For example, to search for a stored procedure with the text "foo", use the following:
SELECT OBJECT_NAME(id) FROM syscomments WHERE lower([text]) LIKE '%foo%' AND OBJECTPROPERTY(id, 'IsProcedure') = 1 GROUP BY OBJECT_NAME(id)
To search through views, replace 'IsProcedure' with 'IsView'.
No comments:
Post a Comment