Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Generazione automatizzata di dati mensili in SQL

Lo pseudocodice:

START    
for each record in master-record
begin
      get the %MONTH% and %YEAR% of the record
      create new record with day:1, month=%MONTH%, and year=%YEAR%, Transaction='Please pay your rent', and etc.
      add the record and calculate the balance
end
add final-record 'Advanced Money Record' with the calculated balance

END

Se hai l'idea, puoi tradurla in tsql-stored-proc.