--将text替换成你要查找的内容
SELECT name,
*
FROM sysobjects o,
syscomments s
WHERE o.id = s.id
AND text LIKE '%text%';
-- and o.xtype = 'P' --存储过程
--将text替换成你要查找的内容
SELECT ROUTINE_NAME,
ROUTINE_DEFINITION,
*
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%text%';
-- AND ROUTINE_TYPE = 'PROCEDURE'; --存储过程