Output Table
Query
Declare @rowtot int
Declare @runtot int
Set @rowtot = 0
Set @runtot = 0
Update RunningTotal
Set
RowTotal = @rowtot,
RunningTotal = @runtot,
@rowtot = coalesce(col1,0)+coalesce(col2,0),
@runtot = @runtot + @rowtot
Select * from RunningTotal

