title: T-SQL: Selecting rows to delete via joins
body: <p>Scenario:</p>
  
  <p>Let's say I have two tables, TableA and TableB.  TableB's primary key is a single column (BId), and is a foreign key column in TableA.</p>
  
  <p>In my situation, I want to remove all rows in TableA that are linked with specific rows in TableB: Can I do that through joins? Delete all rows that are pulled in from the joins?</p>
  
  <pre><code>DELETE FROM TableA 
  FROM
     TableA a
     INNER JOIN TableB b
        ON b.BId = a.BId
        AND [my filter condition]
  </code></pre>
  
  <p>Or am I forced to do this:</p>
  
  <pre><code>DELETE FROM TableA
  WHERE
     BId IN (SELECT BId FROM TableB WHERE [my filter condition])
  </code></pre>
  
  <p>The reason I ask is it seems to me that the first option would be much more effecient when dealing with larger tables.</p>
  
  <p>Thanks!</p>