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

来源:互联网 发布:专业装修设计软件 编辑:程序博客网 时间:2024/05/17 23:01
方法一:
Sql代码 
select * 
from sysobjects o, syscomments s 
where o.id = s.id 
and text like '%yyao%' 
and o.xtype = 'P' 将yyao替换成自己要查找的文本 

方法二:
Sql代码 
select routine_name,routine_definition,routine_type 
from information_schema.routines 
where routine_definition like '%Parent%' 
order by routine_type 
select routine_name,routine_definition,routine_type
from information_schema.routines
where routine_definition like '%Parent%'
order by routine_type 将Parent替换成自己要查找的文本 

方法三:
Sql代码  

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


0 0