问题描述
看一下此链接-http://www.sqlservercentral.com/scripts/T-sql+Aids/31131/,看看是否有帮助。
链接文章中的SP由Prasad Bhogadi编写,内容如下:
CREATE PROCEDURE SEARCHFORSTRING @SEARCHSTRING VARCHAR(100)
AS
SELECT disTINCT(sysobjects.name)
FROM
sysobjects,syscomments
WHERE
sysobjects.id = syscomments.id
AND
sysobjects.type = 'P'
AND
sysobjects.category=0
AND
CHARINDEX(@SEARCHSTRING ,syscomments.text)>0
解决方法
如何在给定数据库的所有存储过程中全局搜索关键字?
我使用了以下内容,但无法获得预期的结果…
SELECT name
FROM sysobjects
WHERE id IN
(
SELECT id
FROM syscolumns
WHERE name = 'loadStatus' COLLATE SQL_Latin1_General_CP1_CI_AS
)
SELECT name
FROM sysobjects
WHERE id IN
(
SELECT id
FROM syscolumns
WHERE name like '%loadStatus%' COLLATE SQL_Latin1_General_CP1_CI_AS
)
问候-Vas