• Jeff Moden (12/1/2015)


    xsevensinzx (12/1/2015)


    This is what I like that everyone despises.

    You're right ... I don't care for all the bracketing BUT, when it's "Squared Up" like you have it, it's not so bad to read.

    It does have some "search" advantages when using "Find" or "Replace", as well.

    Yeah, I actually like to bracket because it contains the field names within a visual container. I also got into the habit of using brackets due to the field names that required it in previous systems.

    With the help of SQL Prompt, I rarely have to type anything because it will auto bracket for me or whatever.

    Regardless, I am a developer at heart and I always tab space my code, caps what I can and keep it organized where I feel others can read it nicely. I really dislike lower caps field names with no visual separations such as:

    Select

    a.id,

    b.product,

    c.color

    From dbo.mytable a

    Join dbo.myothertable b ON a.productid = b.productid

    Join dbo.mythirdtable c ON a.colorid = c.colorid

    Where a.Time >= '2015-10-01'

    And a.Time <= '2015-10-05'

    Order by a.id ASC;

    Like in C or C++ when I write it, I do the same with SQL: