Friday, October 16, 2009

Searching SQL Server TSQL Procedure code

In Sql server this is the query you'd use to find procedures with certain words (like tables etc).
SELECT OBJECT_NAME(id)
FROM syscomments
WHERE lower(text) LIKE '%the code i am trying to find%'
AND OBJECTPROPERTY(id, 'IsProcedure') = 1
GROUP BY OBJECT_NAME(id)
 
In Oracle we would have queried user_source for this information.

No comments:

Post a Comment