Home Forums SQLServerCentral.com Suggestions Please fix the "Pretty Print" class in the forums and the article "Contribution Center" RE: Please fix the "Pretty Print" class in the forums and the article "Contribution Center"

  • Phil Factor (2/5/2012)


    [font="Courier New"]

    WITH

    cteSomeCTE AS

    (--==== This is Jeff's 1st test comment

    SELECT yadayada

       FROM sometable

    )--==== This Jeff's 2nd test comment

    SELECT *

       FROM cteSomeCTE[/font]

    Well the poor old prettifier works with Jeff's code anyway!

    Heh... I just knew that would come up. 😀

    If you look at my original code, there is a single leading space before each SELECT. The prettifier includes that space (as you can see if you quote your own post) but we all know what happens to leading spaces in HTML. They disappear. They need to be entitized as hard spaces as they have been everywhere else leading spaces occur. Not sure why this usually only happens with SELECT but it's been that way ever since I starting using that fine bit of code.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)