• Cursor or No Cursor.

    This is a pretty old war that has been played out a lot on various discussions. Do I use cursors, yes. Do I use cursors on large data sets, hell no!! My typical use of cursors is looping through a small data set to perform some sort of maintenance action, example being loop through DBs to run back ups, custom update stat jobs etc... If you use the cursor with the default settings then yes its a hog, but define what parts of the cursor you want to use. This video from PASS with Kevin Kline and Aaron Bertrand explains in detail. skip over to 20:50 and Aaron will show via a demo how this works.

    https://www.youtube.com/watch?v=XUCxQkFoqpw

    Michael

    thesurfingdba.weebly.com