Hello all,
Please look at the RevenueStreamID column in the picture. I need help writing a code that will essentially loop through this type of process: While not at the end of file, loop through records. Whenever a 7 is found in the RevenueStreamID Column, i need to get the number directly below the 7, update the 7 to that number that is below it. Repeat this process until the end of the record is reached. I then need to put the results of the transformed table into a temp table after the loop is done. Any help would be greatly appreciated.
![alt text][1] [1]:
http://ask.sqlservercentral.com/storage/temp/182-sql-question-5-1-12.jpg