有没有办法在Microsoft SQL Server 2008中的特定数据库的所有存储过程中搜索字符串或文字?
答案 0 :(得分:2)
答案 1 :(得分:0)
select quotename(s.name)+'.'+quotename(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
and o.type = 'P' /* stored procuedure */
inner join sys.schemas s
on o.schema_id = s.schema_id
where m.definition like '%YourSearchText%'
答案 2 :(得分:0)
我认为这对你有用
SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%lq_Campaign%'
AND ROUTINE_TYPE='PROCEDURE'
这是我在其上找到的link。