问题:
I want to search a text from all my database stored procedures. 我想从我的所有数据库存储过程中搜索文本。 I use the below SQL: 我使用下面的SQL:
SELECT DISTINCT
o.name AS Object_Name,
o.type_desc
FROM sys.sql_modules m
INNER JOIN
sys.objects o
ON m.object_id = o.object_id
WHERE m.definition Like '%[ABD]%';
I want to search for [ABD] in all stored procedures including square brackets, but it's not giving the proper result. 我想在包括方括号在内的所有存储过程中搜索[ABD] ,但它没有给出正确的结果。 How can I change my query to achieve this? 如何更改查询以实现此目的?
解决方案:
参考一: https://stackoom.com/question/zhCz/在SQL-Server中搜索存储过程中的文本参考二: https://oldbug.net/q/zhCz/Search-text-in-stored-procedure-in-SQL-Server
来源:oschina
链接:https://my.oschina.net/u/4438370/blog/4257369