How to delete data from multiple tables at once in SQL

The short answer is you can’t. But there is a very nice workaround.

I was perusing StackOverflow and came across this article talking about how to capture information from deleted rows and then use them in a join using the deleted pseudo table:

How do I delete from multiple tables using INNER JOIN in SQL server - Stack Overflow

begin transaction;

   declare @deletedIds table ( id int );

   delete t1
   /* Notice this next line is using the 'deleted' pseudo table: */
   output into @deletedIds;
   from table1 t1
    join table2 t2
      on =
    join table3 t3
      on =;

   delete t2
   from table2 t2
    join @deletedIds d
      on =;

   delete t3
   from table3 t3 ...

commit transaction;