在 SQL Management Studio 2005 中搜索 [英] Searching in SQL Management Studio 2005
本文介绍了在 SQL Management Studio 2005 中搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在存储过程中搜索文本?例如,我想查明某个特定表是否被任何存储过程引用.
Is there a way to search for text within stored procedures? For example I want to find out if a particular table is being referenced by any stored procedure.
推荐答案
SELECT
OBJECT_SCHEMA_NAME(object_id) + '.' + OBJECT_NAME(object_id)
FROM
sys.sql_modules
WHERE
definition like '%whatever%'
syscomments 是遗留的,将定义拆分为 nvarchar 4000 块,因此可能会找不到您想要的内容.这同样适用于 INFORMATION_SCHEMA.ROUTINES
syscomments is legacy and splits the definition into nvarchar 4000 chunks thus risking not finding what you want. The same applies to INFORMATION_SCHEMA.ROUTINES
这篇关于在 SQL Management Studio 2005 中搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文