dcsimg
LinkedIn
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


advertisement
 

Tip: Finding Object Dependencies in SQL

Choose one of these three SQL queries that will return all the database objects that depend on it.


advertisement

Any one of these three queries will return all the database objects that depend on it.

sp_depends 'dbo.TableName'

SELECT *
FROM information_schema.routines ISR
WHERE CHARINDEX('dbo.TableName', ISR.ROUTINE_DEFINITION) > 0

SELECT
referencing_schema_name, referencing_entity_name,
referencing_class_desc, is_caller_dependent
FROM sys.dm_sql_referencing_entities ('dbo.TableName', 'OBJECT')

 

Visit the DevX Tip Bank

 



   
Email AuthorEmail Author
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date