Home Forums SQL Server 2005 Development Using Cursors Inside Stored procedure problem RE: Using Cursors Inside Stored procedure problem

  • With no test data and create table script, cant help much but dont you think you need 'Group By' clause rather than this cursor. I dont think you need a running total but a sum of flat_amount for a transaction TR001 and several other things. It means for each group you need the 'sum' of the flat_amount which warrants for a group by clause. No?

    ---------------------------------------------------------------------------------