• Jeff, your point about cursors is taken, but there are situations where they are, in reality, the best solution to the problem at hand.  Like almost everything else in the SQL Server world, it depends...  Performance and speed is critical, but it isn't the most important consideration.  Logical correctness is the most important thing.  In arriving at the correct answers cursors are a tool, one that is often abused and misused, but a valuable tool nonetheless when the circumstances dictate.

    Andy,

    A very timely article, I switched jobs last year and one of the first things I did was to revise my SQL Server Standards document.  This is a document that I started at least 8 years ago and have carried forward through those years with many additions and revisions along the way. 

    One of the most surprising (to me) changes I made was to the formatting section.  I, like most people have always used all caps for SQL key words and functions.  The developers in my new job had abandoned that practice.  Their argument was that keyword highlighting made that practice unnecessary.  After discussing it, I agreed to try going with lowercase for sql key words.  I expected to not like it and find that readability somehow suffered, but after 6 months of using it, I have yet to find an example where I wished we'd followed the old standard.  I really don't miss hitting the shift key all the time...

    /*****************

    If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek

    *****************/