SQL Studio

[TOP  expression] 
FROM entity_logicalname 
[ WHERE <search_condition> ] 
  • To reduce load on the server, the TOP defaults to 10
  • Any WHERE conditions are evaluated. Once all matching records have been identified, deletes are executed.
  • When a from clause contains inner or left joins, this is being converted into MSCRM Query Expressions. So the fields that can be used as criteria are only those availble on the two connecting entities.
delete from contact 
where contactid in (