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
If you have a hot tip and we publish it, we'll pay you. However, due to accounting overhead we no longer pay $10 for a single tip submission. You must accumulate 10 acceptable tips to receive payment. Be sure to include a clear explanation of what the technique does and why it's useful. If it includes code, limit it to 20 lines if possible.
Submit your tip here.