• Although it is true that you should try your best to avoid the cursor, a particular feature in any language exists because it has some usage.

    See the DECLARE CURSOR Transact-SQL help in SQL Server Books Online and you will find and detailed example right at the bottom of that article.

    Hope it helps.

    Nitin.