Ms Sql Server查詢儲存過程中的內容
--查詢存在某表名的儲存過程
SELECT distinct b.name from syscomments a,sysobjects b
WHERE a.id=b.id and a.TEXT LIKE '%你要查詢的表名%'
--查詢存在某內容的儲存過程
SELECT NAME FROM sysobjects o, syscomments s
WHERE o.id = s.id
AND TEXT LIKE '%你要查詢的內容%'
AND o.xtype = 'P'
--查詢存在某內容的儲存過程名稱及儲存過程內容
SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%你要查詢的內容%'
AND ROUTINE_TYPE='PROCEDURE'