如何在SQL Server过程/触发器中查找文本? [英] How to find a text inside SQL Server procedures / triggers?

查看:117
本文介绍了如何在SQL Server过程/触发器中查找文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个将更改的链接服务器.某些过程像这样调用链接的服务器:[10.10.100.50].dbo.SPROCEDURE_EXAMPLE.我们也有触发器在做这种工作.我们需要找到所有使用[10.10.100.50]进行更改的地方.

I have a linkedserver that will change. Some procedures call the linked server like this: [10.10.100.50].dbo.SPROCEDURE_EXAMPLE. We have triggers also doing this kind of work. We need to find all places that uses [10.10.100.50] to change it.

在SQL Server Management Studio Express中,我没有在Visual Studio中找到诸如在整个数据库中查找"之类的功能.特殊的系统选择可以帮助我找到所需的东西吗?

In SQL Server Management Studio Express, I didn't find a feature like "find in whole database" in Visual Studio. Can a special sys-select help me find what I need?

推荐答案

这是我在系统上用于查找文本的过程的一部分.

here is a portion of a procedure I use on my system to find text....

DECLARE @Search varchar(255)
SET @Search='[10.10.100.50]'

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 '%'+@Search+'%'
    ORDER BY 2,1

这篇关于如何在SQL Server过程/触发器中查找文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆