>If I have to, I will, once again, write a procedure to scan the table and write the cursor, but it would be nice to make it with a SQL SELECT.
We've always made fun of gorgeous machines and/or program(ming language)s that do many glorious things, saying "yea, fine, but can it make coffee?". Now if ever something which really makes coffee (along with the useful stuff it was designed for), I guess next question will be "yea, fine, but can it make coffee using pure SQL only?".
Getting to really think of the problem, I can't stop thinking of Ed's solution for running totals... now I can't think of anything else but using an UDF which will keep the previous line's running total in an outside variable and update it everytime and return the difference. But then, that's no better than scan.