title: How to Update common column values from different values in SQL server?
body: <p>I have two tables. My first <code>table A</code> contains </p>
  
  <pre><code>Tran_Particular | Dr_Tran_Amt | BeneficiaryName | PRNNo 
  </code></pre>
  
  <p>columns.</p>
  
  <p>My second table B contains </p>
  
  <pre><code>BeneficiaryName | Dr_Tran_Amt | PRNNo
  </code></pre>
  
  <p>columns.</p>
  
  <p>I want to update table <code>A.PRNNo</code> but When I am updating this on <code>BeneficiaryName</code> and <code>Dr_Tran_Amt</code> that time it updates only first value. But In <code>table B</code> there are two PRNNO's are exist and In <code>table A</code> also two different <code>Tran_Particular</code> are exist. I want to update unique PRNNO wrt <code>Tran_Particular</code>, <code>BeneficiaryName</code> and <code>Dr_Tran_Amt</code>.</p>
  
  <p><strong>Query</strong>.</p>
  
  <pre><code>update A
    set a.PRNNo = b.PRNNo
  from A a
    inner join B b
      on  a.Dr_Tran_Amt= b.Amount
      and a.BeneficiaryName = b.BeneficiaryName;
  </code></pre>
  
  <p>HoW to update this in SQL server.<br></p>
  
  <p><img src="https://i.stack.imgur.com/JPoO3.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/xpfND.png" alt="enter image description here"></p>