title: SQL Server: How do you insert rows where some rows might have duplicate keys?
body: <p>I need to insert dozens of rows, but my table has a unique key and some of the inserted rows might have the same unique key as existing rows in the table.</p>
  
  <p>How can I safely instruct the database to only insert the rows that don't contain duplicate keys, and ignore the duplicates?</p>
  
  <p>(I was thinking along the lines of <code>INSERT ... WHERE NOT EXISTS ...</code> but I don't think it's possible?)</p>