Tags

, ,


some time we need to find the text in all procedures in SQL Server, the following qurey is helpful for finding the text in Procedures.

 SELECT
     Distinct
SO.Name
FROM
sysobjects SO (NOLOCK)
     INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID
        
AND
    SO
.Type = ‘P’
        AND
     SC
.Text LIKE ‘%text%’
ORDER BY
  
  SO.Name

 Enjoy!

Advertisements