Oracle/MSSQL中通过关键字查找所有存储过程

Oracle

查找函数

select t.name,t.text from all_source t where type = 'PROCEDURE' and text like '%var_app_1_pst%'

查找存储过程

select t.name,t.text from all_source t where type = 'FUNCTION' and text like '%var_app_1_pst%'

MSSQL

select b.name 
from 数据库名.dbo.syscomments a, 数据库名.dbo.sysobjects b 
where a.id=b.id  and b.xtype='p' and a.text like '%key words%'
order by name

Oracle中,如果关键字是一张表的话,还可以通过表的Referenced by属性找到相关的函数、存储过程和触发器等。

如:

MSSQL类似。

 

原文地址:https://www.cnblogs.com/su1643/p/6598704.html