Software Development : A dizzy job...keeping abreast and being competitive is a 24X7 involvement
Sep 8, 2004
Hey did u know about this "To find which objects are referencing a Table in SQL or Table
dependency ?"
>> sp_depends 'object name'
>>sp_depends tblAFDUserMaster (no quotes)
>>select object_name(constid) as constraint_name, object_name(fkeyid) as table_name
from sysreferences
where object_name(rkeyid) = 'your table name' (with quotes)
>>select object_name(constid) as constraint_name, object_name(fkeyid) as table_name
from sysreferences
where object_name(rkeyid) = 'TABLE_BROKER'
>>Select id from sysobjects where name='tblAFDUserMaster'
>>select object_name(constid) as constraint_name,object_name(fkeyid) as table_name
from sysreferences
where object_name(rkeyid) in
(select distinct object_name(rkeyid) as ConstraintName
from sysreferences
where fkey1>1)
Subscribe to:
Posts (Atom)