title: Insert and Update in one query in sql server 2005
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3593870/select-insert-version-of-an-upsert-is-there-a-design-pattern-for-high-concurr">Select / Insert version of an Upsert: is there a design pattern for high concurrency?</a>  </p>
  </blockquote>
  
  
  
  <p>I have to insert data from one table to another on the basis of condition.</p>
  
  <pre><code>1.If Key is found update records
  2.If key is not found insert the record.
  </code></pre>
  
  <p>I am using sql server 2005. So can not use <code>merge</code> statement. Please suggest the alternative to achieve this</p>