Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL
Expertise: Intermediate
Oct 11, 2005

Locate All Stored Procedures and Their Objects/SQL Tables

Sometimes, for documentation purposes, you need to locate all the stored procedures and objects/SQL tables upon which they depend. The following code shows you how:

select distinct A.name as sproc_name, C.name as dep_obj_name, C.xtype as dep_xtype
from sysobjects A
inner join sysdepends SD on A.id=SD.id
inner join sysobjects C on SD.depid=C.id and C.xtype in ('S', 'U', 'P', 'FN')
where A.xtype = 'P'
and   C.xtype = 'U'
AND   A.Status > 0
order by A.name, C.name
Daljinder Singh
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap