September 3, 2013 at 12:01 am
Hi,
I want to get the list of dependency tables(through all the levels ie child of child) that are depends on the parent table using T-SQL.
September 3, 2013 at 2:14 am
Take a look at the following article: http://technet.microsoft.com/en-us/library/ms345449(v=sql.105).aspx
Keep in mind that it's possible the reported dependencies are NOT up-to-date. Some objects can be created when the depending object(s) does not exist yet. These dependencies won't be recorded.
September 4, 2013 at 2:33 am
select OBJECT_NAME(OBJECT_ID) as procName,* from sys.sql_modules where definition like '%<tablename>%'
September 4, 2013 at 9:19 am
SELECT referencing_schema_name, referencing_entity_name,
referencing_id, referencing_class_desc, is_caller_dependent
FROM sys.dm_sql_referencing_entities ('YourObject', 'OBJECT');
If you want a recursive lookup, check out this:
Francis
-----------------
SQLRanger.com
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy