1. 程式人生 > >查詢儲存過程的內容

查詢儲存過程的內容

[b]1.Oracle中下面這麼寫[/b]

按名查詢儲存過程:
select * from user_objects
where Object_Type='PROCEDURE' and object_name like '%'||upper('p')||'%'

按內容查詢儲存過程:
SELECT * FROM ALL_SOURCE where TYPE='PROCEDURE' AND TEXT LIKE '%'||upper('clean_')||'%'

有點慢,MS沒什麼好方法

[b]2.MS Server中下面這麼寫[/b]

按名查詢儲存過程:
EXEC Sp_HelpText '儲存過程名';

按內容查詢儲存過程:
select b.name
from kbmp.dbo.syscomments a,kbmp.dbo.sysobjects b
where a.id=b.id and b.xtype='p' and a.text like '%if_check%';