Friday, October 16, 2009

How To Search Text In Script In Database In Procedure

    DECLARE @srchString VARCHAR(1000)
    SET @srchString='Procedure_Name'
    SET @srchString = '%' + @srchString + '%'    
    SELECT O.NAME FROM syscomments  C
    JOIN sysobjects O ON O.id = C.id
    WHERE O.xtype = 'P' AND C.TEXT LIKE @srchString

No comments: