Basically I am trying to get the sum of a column in my detail rows into the footer of an exported flat file. I created a variable called footer which has the row count. Now I am trying to add the sum of a column to the footer as well. Is there a way to create a variable called Sum and assign it the value of the sum from my SQL Task?
declare @Sum decimal
select @sum = sum(convert(decimal(12,2),debt_amount)) from my_vw