title: distribute value to all rows while updating table
body: <p>I have table structure like <code>tblCustData</code></p>
  
  <pre><code>ID    UserID    Fee FeePaid
   1      12      150   0
   2      12      100   0
   3      12      50    0
  </code></pre>
  
  <p>And value to be update in <code>FeePaid</code> Column such that if i have value in <code>@Amt</code> variable in <code>200</code> Then it should update <strong>any</strong> two rows </p>
  
  <p>Output should be like </p>
  
  <pre><code>ID    UserID    Fee FeePaid
  1      12       150   150
  2      12       100   50
  3      12       50    0
  </code></pre>
  
  <p><code>FeePaid</code> should not be grater than <code>Fee</code> Column But if i pass <code>350</code> in <code>@Amt</code> variable it should produce output like</p>
  
  <pre><code>ID    UserID    Fee FeePaid
  1       12      150   200
  2       12      100   100
  3       12      50    50
  </code></pre>
  
  <p><strong>Only if <code>@Amt</code> is exceeding the total value in <code>Fee</code> column</strong></p>
  
  <p>I can not think beyond this query</p>
  
  <pre><code>Update tblCustData
  Set FeePaid=@Amt
  Where UserID=12
  </code></pre>