Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 15264

How to check the dependencies of a SQL Table in SQL Server 2000

$
0
0
Hi all,

I m using SQL Server 2000. I want to know the Dependencies of a particular table in my database. I want to know the details inorder to delete the records which are not referenced from  other related tables.

(e.g) Customer, CustomerTax, Invoice tables are there. CustomerID is primary key in Customer table. CustomerID is Foreign keys in CustomerTax and Invoice tables.

When i create new customer i enter customer tax also. So both Customer and Customertax details are stored in the tables. Once i created the customer details it not yet reference in invoice table i can deactivate(later i can again activate the customer) the customer, because it is not refered in Invoice table(eventhough it is refered in CustomerTax table). In my view Customer and CustomerTax are very close association with them.(Without client the client tax not exists).

So whenever i want to deactivate a particular customer i have to check which tables that customer ID is refereneced. If it is referenced any other tables except CustomerTax table then i will intimate the user that customer ID is already referenced by other tables(other than CustomerTax).

For this purpose i want to check the dependencies of the table and decide to deactivate the customer record or not. How can i achieve this in SQL Server 2000?

I am in urgent need for this problem. Can anyone please suggest for this problem? If so i am very greatfull for you.

Thanks in advance
cssjm

Viewing all articles
Browse latest Browse all 15264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>