Take a look here:
Calculating Running Total with OVER clause and Partition By Clause in SQL Server[
^]
So, in your case it should be like this:
CREATE TABLE CsLedg
(
LedgId int IDENTITY(1,1),
Bill int,
Paid int
);
INSERT INTO CsLedg(Bill, Paid)
VALUES(75, 0),
(0, 50),
(780, 0),
(500, 0),
(0, 1000),
(780, 0),
(77, 0);
SELECT LedgId, Bill, Paid, SUM(Bill-Paid) OVER(ORDER BY LedgId) As Balance
FROM CsLedg
SQL Server 2019 | db<>fiddle[
^]
More examples:
Use SQL to Calculate a Running Total - Essential SQL[
^]
4 Ways to Calculate a Running Total With SQL[
^]