title: Deleting Related Rows in a Many-to-Many Relationship
body: <p>I'm deleting a row in a table that is on one site of a many-to-many relationship. I would also like to delete any related rows on the other side of that relationship.</p>
  
  <p>For example, let's say I have the following tables and I want to delete a row from <code>Cars</code>. I would also want to delete any related rows from <code>Drivers</code> and, of course, any rows no longer needed in <code>CarDrivers</code>.</p>
  
  <pre><code>Table Cars:
  CarID      int
  CarName    nvarchar(100)
  
  Table Drivers:
  DriverID   int
  DriverName nvarchar(100)
  
  Table CarDrivers:
  CarID      int
  Driver     int
  </code></pre>
  
  <p>I know how to join the tables above in a <code>SELECT</code> query. But I don't see how to delete data across the relationship.</p>
  
  <p>Note: Both sides of the relationship implement cascading deletes. So, for example, deleting a row from <code>Cars</code> will delete any related rows in <code>CarDrivers</code>. But obviously that doesn't propagate to the <code>Drivers</code> table.</p>