查询数据库中所有包含某文本的存储过程、视图和函数的SQL

方法一:

1 select*
2  from sysobjects o, syscomments s
3  where o.id = s.id
4 andtextlike'%yyao%'
5 and o.xtype ='P'

将yyao替换成自己要查找的文本 

方法二:

1 select routine_name,routine_definition,routine_type
2 from information_schema.routines
3 where routine_definition like'%Parent%'
4 orderby routine_type

将Parent替换成自己要查找的文本 

方法三:

1 sp_depends customer

此方法只能查找数据库对象,如表、视图、存储过程、函数

原文地址:https://www.cnblogs.com/luluping/p/2415394.html