Question

Track dependent items

Is there a way to know what objects depend on other objects.

For instance, there is an object I want to delete. When I try to delete I receive this error

 

Unable to delete item "UsrExample" of package "Custom". It has dependent items

 

How can I find these dependent items?

Thanks in advance!

Like 0

Like

1 comments

Dear Tyler,

 

There are two ways how an object can dependent on another object:

 

1. A dependent object has reference to another table on the database level (foreign key constraint). In order to determine all tables that reference particular table please use the sql-query that is provided in the article by the link below:

https://stackoverflow.com/questions/11866081/mssql-how-to-i-find-all-tables-that-have-foreign-keys-that-reference-particular

 

2. The dependent object can have some object as a parent. In order to determine all objects for which particular object is a parent please use the script below:

 

Select * from SysSchema

Where ParentId = 'Id of the parent object (The "Id" column from the "SysSchema" table)'

 

Best regards,

Norton

Show all comments