Delete rows from two tables atomically in SQL Server?

How to delete rows from different tables atomically?

Table A has a primary key and a foreign key in table B.

+3
source share
1 answer

The standard solution is to use ON DELETE CASCADE for your restriction. Find the "cascade" on this page.

If this is not an option, this SO question might interest you: In SQL Server 2005, can I cascade delete without setting a property in my tables?

+6
source

All Articles