Monday, March 19, 2012

Search stored procedure's text

http://blog.sqlauthority.com/2007/09/03/sql-server-2005-search-stored-procedure-code-search-stored-procedure-text/

USE AdventureWorks
GO

--Searching for Empoloyee table
SELECT Name FROM sys.procedures WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%Employee%'
GO
--Searching for Empoloyee table and RateChangeDate column together
SELECT Name FROM sys.procedures WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%Employee%'AND   OBJECT_DEFINITION(OBJECT_ID) LIKE '%RateChangeDate%'
GO 

Followers

Blog Archive