title: Checking Duplicates before inserting into SQL database
body: <p>So I've been doing some research and I need to write up an <code>INSERT</code> statement to insert unique client names into a table on my server. However the default standard of the database already has thousands of clients in it, and when inserting new clients we need to check if they already exist before attempting to add it to the system. </p>
  
  <p>My question is what would be the best/fastest way to do this? Would it be better to run a simple select query on the clients table (ordered by ASC), and do a binary search or something on the results, or perhaps just do a SQL query similar to the one below?</p>
  
  <pre><code>IF NOT EXISTS (SELECT 1 FROM clients AS c WHERE c.clientname = ?)
  BEGIN
    INSERT INTO clients (clientname, address, ...)
    VALUES (?, ?, ...)
  END
  </code></pre>
  
  <p>Is this a slow statement? I may have to run the insert several hundred times per each submission.</p>