no offense but that's still slow as hell.
I have a script that calculates the inventory per location as well as total per item for each of all 900 000 transaction in our system.
It takes 30 seconds to run those steps :
Copy the full table into temp table (only required columsn obviously)
Put a clustered index
Do the first calculation that updates 900 000 rows based per location.
Drop the clustered index
Build the clustered index based on different keys
run the update for the 2nd column.
All that takes only 25 seconds and assuming my math is still ok, that's over 4.5M lines written! Ok that's a nice server (2 cpus dual core, 16 GB of ram and san drives) but it's still a freaking heck of a lot faster than what you have right now.
A base comparaison would be that I update 150 000 rows a second with my code while you write 36 rows per seconds. That only 4166 times faster than your code... just saying :w00t:.