title: SQl: Update Table from a text File
body: <p>Here's what I have to do :</p>
  
  <p>I have a text file which has 3 columns: <code>PID, X, Y</code>. </p>
  
  <p>Now I have two tables in my database:</p>
  
  <ul>
  <li><code>Table 1</code> contains 4 columns: <code>UID, PID, X, Y</code></li>
  <li><code>Table 2</code> contains multiple columns, required ones being <code>UID, X, Y</code></li>
  </ul>
  
  <p>I need to update <code>Table 2</code> with corresponding X and Y values.</p>
  
  <p>I think we can use <code>BULK INSERT</code> for updating <code>table 1</code>, then some <code>WHILE</code> loop or something.</p>
  
  <p>But I can't figure out exact thing.</p>