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類似。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM