title: Sql insert multiple rows if not exists
body: <p>I have a sql table that has two columns id and name. I have list of names about 20 and I need to write a query that checks if name exists before insert. </p>
  
  <p>Is there a better way of doing this rather then just having  the below query 20 times but with different names (I need do this in t-sql):</p>
  
  <pre><code>IF NOT EXISTS(SELECT* 
                FROM   mytable 
                WHERE  name = 'Dan') 
    BEGIN 
        INSERT INTO mytable 
                    (name) 
        VALUES     ('dan') 
    END 
  </code></pre>