• I concede that this task can be done with a set-based command that generates a list of commands.. lol.. now let's consider a moment.

    Now consider your task may take a LARGE block of dynamic SQL (say about 6000 characters) that you're going to execute against all 300 tables.. do you still want to generate a character variable to hold this massive statement so that if (when) it breaks you'll get "Error on line 1 of...." or hey! put it in a procedure and THEN put it in your statement to save space.. but then you still get "Error on line 1 of..." when it breaks.

    Generally, I use a cursor because it's a non-production issue, it's developmental and I'm using it only to save myself typing time.. it's likely a one time event.. but I'd rather have ONE particular command fail that I can debug than have the whole block fail and try to figure out where it's falling down.

    The point I was trying to get across was that there ARE times an places that a cursor can be useful.. just need to be careful about when and where, you know?