How do I find a stored procedure containing ?

后端 未结 20 2077
梦谈多话
梦谈多话 2020-11-28 17:21

I need to search a SQL server 2008 for stored procedures containing where maybe the name of a database field or variable name.

20条回答
  •  独厮守ぢ
    2020-11-28 17:42

    How to Find a Stored Procedure Containing Text or String

    Many time we need to find the text or string in the stored procedure. Here is the query to find the containing text.

    SELECT OBJECT_NAME(id) 
    FROM SYSCOMMENTS 
    WHERE [text] LIKE '%Text%' 
    AND OBJECTPROPERTY(id, 'IsProcedure') = 1 
    GROUP BY OBJECT_NAME(id)
    

    For more information please check the given URL given below.

    http://www.freshcodehub.com/Article/34/how-to-find-a-stored-procedure-containing-text-or-string

提交回复
热议问题