title: In SQL Server, how can I insert values into table EXCEPT repeat rows?
body: <p>I wrote a python script which would look at a text file and create SQL code which would insert data into a table.  </p>
  
  <p>It looked like this:</p>
  
  <pre><code>insert into table1 (date, locid, personid, itemid, amounts) 
     values (val11,val12,val13,val14,val15)
           ,(val21,val22,val23,val24,val25)
  </code></pre>
  
  <p>The data is structured so that for a particular set of values the first four columns <code>(date, locid, personid, itemid)</code>, there will be at most one row.</p>
  
  <p>At the moment, I have to check by hand if an entry already exists in the table, then remove it from the insert statement.</p>
  
  <p>How can I enter this data into the DB without manually checking for repeats?</p>