我有一个查询,它从所选数据库(不是作业和表数据)中找到过程/函数/触发器中的给定文本:
Declare @SearchStr varchar(256) = 'MyStringToSearchFor'
SELECT
OBJECT_NAME(object_id),
OBJECT_SCHEMA_NAME(object_id) as SchemaName,
definition
FROM
sys.sql_modules
WHERE
definition LIKE '%'+@SearchStr+'%'
有没有办法自动替换其他字符串找到的字符串?