• KoldCoffee (5/20/2013)


    In that case I was trying to learn cursors, and there was no better way. I even prefaced and said something like, I don't want to be talked out of a cursor because I am aware of pros and cons...in the hopes of avoiding getting derailed.

    Otherwise, I always agree with platitudes.

    Okay, here is my opinion about learning cursors, should be done as a last resort or in an effort to figure out what someone else has done using cursors in an effort to replace with a set-based solution.

    The problem I have seen is that once someone has figured out how to use a cursor, every problem after that is solved with a cursor. And things work great when run against 10 to 100 records, but then you find people nesting cursors and running those nested cursors against tables with 1,000's to 10'000's of records and wondering why the process is extremely slow.

    One of the things we try to do here on SSC is pass on our knowledge and experience in an effort to make others better at their chosen craft without necessarily having to make the same mistakes we made in learning when resources like this weren't available. I had worked with SQL Server for over 7 years before I became involved on SSC, and I learned more about doing things right in my first 5 years of active participation on SSC then in the previous 7 years before that.

    I am trying hard to give back to a community that helped me learn more because it is the right thing to do, not to make me feel better or superior to others.