• 方法一:查詢所有包含某文本的存儲過程、視圖、函數

SELECT * from sysobjects o, syscomments s where o.id = s.id AND text LIKE '%text%'
• 方法二:

select routine_name,routine_definition,routine_type from information_schema.routines where routine_definition like'%exec%' ORDER BY routine_type