In the transaction database,
I have a table named CustomerDetails which have the table definition below:
( CustomerID BigInt IDENTITY(1,1),
Another table named OrderDetails which have the table definition below:
( OrderID BigInt IDENTITY(1,1),
There is a foreign key relationship between CustomerDetails. CustomerID & OrderDetails. CustomerID.
There are some other tables which are having CustomerID in those tables & having foreign key constraint set on.
So the child tables like OrderDetails needs to be deleted, then only a particular Customer record can be deleted from CustomerDetails.
Is there any query which can be used to delete the child records in tables & then delete the parent recod in parent table ie. CustomerDetails