title: SQL server update error - Msg 2627
body: <p>I am trying to update my table "tender". </p>
  
  <p>It has these columns:</p>
  
  <ul>
  <li>requisition no(rq_no)</li>
  <li>requisition year(rq_year)</li>
  <li>tender number(te_no)</li>
  <li>te_date</li>
  <li>te-due_date</li>
  <li>tender status(te_status)</li>
  <li>te_year</li>
  </ul>
  
  <p>I tried the below code:</p>
  
  <pre><code>update tender 
  set te_status='D'
  where rq_no like 'Q052401C' AND te_year like '2012' and te_no like 'n0066'
  </code></pre>
  
  <p>if I place any other character in place of <code>'D'</code> in <code>te_status</code>, update is successful except for 'D'
  e.g.:</p>
  
  <pre><code>set te_status='S'
  </code></pre>
  
  <p>When I run</p>
  
  <pre><code>SELECT * FROM TENDER
  WHERE
      rq_no LIKE 'Q052401C' AND te_year LIKE '2012' AND te_no LIKE 'n0066'
  </code></pre>
  
  <p>, it returns a single row.</p>
  
  <p>Ιt shows me the following error:</p>
  
  <blockquote>
    <p>Msg 2627, Level 14, State 1, Line 1
    Violation of PRIMARY KEY constraint 'PK_tender'.
    Cannot insert duplicate key in object 'dbo.tender'.
    The duplicate value is (N0066, Q052401C, D, 2012)
    The statement has been terminated.</p>
  </blockquote>
  
  <p>What does all these mean?</p>