How to write query to Delete the records in child table
and corresponding records in parent table
Answer Posted / dileep
Better you create a Trigger on child table like this one
CREATE TRIGGER trDelTrigger ON [dbo].[ChildTable]
FOR DELETE
AS
DELETE FROM ParentTable WHERE ParentTable.IdColumn=
(SELECT Deleted.IdColumn FROM Deleted)
| Is This Answer Correct ? | 9 Yes | 5 No |
Post New Answer View All Answers
What is difference between after and before?
How do I view views in sql server?
How can we solve concurrency problems?
What does this statement do @@rowcount?
Can you leave a union at any time?
Which language rdl files made of?
Explain about SQLOS?
List down some advantages of sql stored procedure?
How to drop an existing table?
What is equi join with example?
What is thr feature of change data capture?
Can we add an identity column to decimal datatype?
Why do we backup Active Directory ?
What is use of dbcc commands?
Do you know what is user defined datatypes and when you should go for them?