• @hugo:

    I'm not an expert in SQL. I was also under the impression that Cursors are a big NO and hence should be avoided at all costs. I'm only saying that after reading numerous articles which states that. Now I'm really curious to see your explanation and to learn why Cursors may be better in some cases.

    The situation that you've mentioned here is quite interesting. Would you also be posting the cursor solution for this?