• homebrew01 (12/26/2013)


    Just a General Request.

    When giving a helpful reply, throw in a few comments to explain some of the less obvious SQL statements. It can make a world of difference to have even a few words explaining some of the logic & syntax, and only takes a few seconds to type it.

    It can save the reader, especially a newbie, lots of head scratching.

    I suspect Jeff (and probably others) may disagree with me here but there's another school of thought.

    While good comments explaining what is going on is great in Prod code, helpful answers to a forum question are those that help the OP learn.

    That may mean a little bit of head scratching. Seriously, are you willing to dump some code into Prod just because you found it on the Internet? Better to dissect it and thoroughly understand it first. Comments may possibly distract you from doing that, by beguiling you into thinking that you know what is going on when in reality you may not.

    I'm always available to answer questions if you don't understand some code I've posted.


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St