title: SQL Server Column Mapping
body: <p>I have three scenarios that i'd like to handle, with some remapping i'm doing. </p>
  
  <p>Scenario #1
  I have Table A</p>
  
  <blockquote>
    <p>Column A, Column B<br>   1, NULL  <br> 2, NULL  <br> 3, NULL  <br> 4,
    NULL  <br> 5, NULL  <br> 6, NULL  <br></p>
  </blockquote>
  
  <p>How Can I Update Column B such that I begin with the next value of Column A  </p>
  
  <blockquote>
    <p>Column A, Column B  <br> 1, 7  <br> 2, 8  <br> 3, 9  <br> 4, 10  <br>
    5, 11  <br> 6, 12  <br></p>
  </blockquote>
  
  <p>Scenario #2
  I have Table A  </p>
  
  <blockquote>
    <p>Column A, Column B  <br> 1, NULL  <br> 1, NULL  <br> 2, NULL  <br> 2,
    NULL  <br> 3, NULL  <br> 3, NULL  <br> 3, NULL  <br></p>
  </blockquote>
  
  <p>How Can I Update Column B such that I begin with the next value of Column A but insuring I only update the values as a group like so  </p>
  
  <blockquote>
    <p>Column A, Column B  <br> 1, 4  <br> 1, 4  <br> 2, 5  <br> 2, 5  <br>
    3, 6  <br> 3, 6  <br> 3, 6  <br></p>
  </blockquote>
  
  <p>Scenario #3
  I have Table A that contains gaps in Column A  </p>
  
  <blockquote>
    <p>Column A, Column B  <br> 1, NULL  <br> 1, NULL  <br> 4, NULL  <br> 4,
    NULL  <br> 6, NULL  <br> 6, NULL  <br> 6, NULL  <br></p>
  </blockquote>
  
  <p>How Can I Update Column B such that I begin with the next value of Column A but insuring I only update the values as a group like so  </p>
  
  <blockquote>
    <p>Column A, Column B  <br> 1, 7  <br> 1, 7  <br> 4, 8  <br> 4, 8  <br>
    6, 9  <br> 6, 9  <br> 6, 9  <br></p>
  </blockquote>
  
  <p>Can I possibly handle all three of these scenario's in one statement? If so, how?
  Any help is much appreciated!  </p>