在SQL Server中搜索存储过程中的文本

拈花ヽ惹草 提交于 2020-04-29 01:05:16

问题:

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
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!