• 方法一:查询所有包含某文本的存储过程、视图、函数

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