Вы можете попробовать использовать рекурсивный CTE. Учтите это:
CREATE TABLE #RawData(Contract int, Rental_Period_From Date, Rental_Period_To Date, Invoice_Number int, Amount Decimal(10,2))
INSERT INTO #RawData VALUES(31225, '9/1/2019','9/30/2019', 6378,400.00)
INSERT INTO #RawData VALUES(12345, '9/1/2019','11/30/2019', 789,150.00)
;WITH CTE
AS
(
select Contract,Rental_Period_From DueDate,Invoice_Number,Amount, 0 MonthCounter, Rental_Period_To from #RawData
UNION ALL
SELECT Contract, DATEADD(month,MonthCounter+1,DueDate),Invoice_Number,Amount, MonthCounter,Rental_Period_To from CTE
WHERE DATEADD(month,MonthCounter+1,DueDate) <= Rental_Period_To
)
SELECT CONTRACT, DueDate,Invoice_Number, CAST(Amount / (SELECT COUNT(*)
FROM CTE t1 WHERE t1.Contract = t2.Contract ) as decimal(10,2)) Amount
FROM CTE t2