Actually I got this article from here and then I explored it. The transact-sql cursor becomes my problem since the customer’s data has grown, I don’t know which way I could do it to loop the query results. But it was :).

If I declare a cursor, my run time will be 25 seconds in a large amount of data, but when I loop it by using normal iteration, it only took time 10 seconds :) For example (my Intran table has around 1,000,000 records)

(more…)