--將text替換成你要查找的內容
SELECT name,
*
FROM sysobjects o,
syscomments s
WHERE o.id = s.id
AND text LIKE '%text%';
-- and o.xtype = 'P' --存儲過程object
--將text替換成你要查找的內容
SELECT ROUTINE_NAME,
ROUTINE_DEFINITION,
*
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%text%';
-- AND ROUTINE_TYPE = 'PROCEDURE'; --存儲過程存儲過程