Your code is looping over the recordset and for each record it needs to execute one, possibly two, stored procedures. It's normal that this is slow, it's comparable to using a cursor in T-SQL: avoid if you can!
The only way to make this faster is to replace your current implementation with set-based logic.
This may be an interesting read: [The Road to Professional Database Development: Set-Based Thinking][1]
[1]: http://www.simple-talk.com/sql/database-administration/the-road-to-professional-database-development-set-based-thinking/
↧