• Good introduction! Looking forward to reading part 2 (+1).

    And totally agree with Kev. I only want to add that nobody is asking anybody to fire their cursors if they prefer to keep them ...

    And to avoid maybe unnecessary posts ... yes the cursor should be closed and deallocated and select count(*) is not the solution to avoid cursors in the example, although it would suit the requirements here.