create table #t ( Ordid int primary key , Receiptqty int , Issueqty int)
insert #t(Ordid,Receiptqty,Issueqty) values (1,2577,0)
insert #t(Ordid,Receiptqty,Issueqty) values (2,2577,0)
insert #t(Ordid,Receiptqty,Issueqty) values (3,7903,0)
insert #t(Ordid,Receiptqty,Issueqty) values (4,7893,0)
insert #t(Ordid,Receiptqty,Issueqty) values (5,7920,0)
insert #t(Ordid,Receiptqty,Issueqty) values (6,7922,0)
insert #t(Ordid,Receiptqty,Issueqty) values (7,6903,0)
insert #t(Ordid,Receiptqty,Issueqty) values (8,7920,0)
insert #t(Ordid,Receiptqty,Issueqty) values (9,7922,0)
--select * from #t order by Receiptqty
-- Running Total for SQL Server 2008 R2 and Earlier Version
SELECT Receiptqty, Issueqty,
(SELECT SUM(Receiptqty-Issueqty)
FROM #t T2
WHERE T2.Ordid <= t1.Ordid) AS RunningTotal
FROM #t T1
GO
drop table #t