--查找存在某表名的存儲過程 SELECT distinct b.name from syscomments a,sysobjects b WHERE a.id=b.id and a.TEXT LIKE '%你要查找的表名%' --查找存在某內容的存儲過程SELECT NAME FROM sysob ...
--查找存在某表名的存儲過程
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'