title: How do you find if a unique pair value already exists in a sql table?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2594829/finding-duplicate-values-in-a-sql-table">Finding duplicate values in a SQL table</a>  </p>
  </blockquote>
  
  
  
  <p>I'm completely new to T-Sql and Sql programming in general so I'm hoping someone can steer me in the right direction. Here's my problem.. I have a table with only 2 columns, AppliedBandwidthSourceKey and AppliedBandwithSource for simplicity I'll call them columns A and B respectively. </p>
  
  <p>Columns A and B compose the primary key. When I try to insert a record where the value for column A already exists I immediately get a Primary Key constraint violation and if column A doesn't exist but column B does I get Unique Key constraint violation. My question is how do I check if the 'value pair' already exists in the table? if does then do nothing otherwise insert. </p>
  
  <p>I've seen several solutions to similar problems using tsql's merge and if not exists statements but I just can't grasp the concept. Any help would be greatly appreciated.  </p>