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 are the new features of sql server 2012 reporting service?
What do we have to check in database testing?
Can you explain important index characteristics?
What are different replication agents and what's their purpose? : sql server replication
How to disable triggers using "disable trigger"?
What is the difference between Triggers and Stored Procedure?
What is a transaction and why is it important?
 Explain what is sql override for a source taLle in a mapping?
What do you understand by recursive stored procedure?
What is the maximum size per database for sql server express?
What are the types of containers in ssis?
How many servers can we create in a single subscription?
What are the differences between having and where clause.
Explain the stored procedure?
How to stop log file growing too big?