• From your example, you just need to get rid of the cursor. I'm sure that it would be more complicated than that, but the best option is if you share the real code to avoid the cursor completely.

    SELECT ITEM_DESCRIPTION

    FROM #ITEMS;

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2