Are the posted questions getting worse?

  • Brandie Tarvin wrote:

    Forget leading commas. Let's debate leading semi-colons. @=)

    This could start a flame war! I've seen instances of otherwise-seasoned coders on here using the dreaded

    ;WITH CTE AS (

    pattern, as if it's the right thing to do.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Jeff Moden wrote:

    David Burrows wrote:

    Jeff Moden wrote:

    David Burrows wrote:

    Thatโ€™s why I like you Jeff, youโ€™re such a smart guy ย ๐Ÿ˜๐Ÿฅณ

    Heh... if I were really smart, I'd just up and retire.ย  That would probably kill me though.

    Just like me ๐Ÿ˜‚, glad I didnโ€™t. Youโ€™ll out live us all ๐Ÿ˜€ youโ€™re an institution you know ๐Ÿ˜ƒ

    I think most folks would say your confused, David.ย  They rather think I should be IN an institution. ๐Ÿ˜€ ๐Ÿ˜€ ๐Ÿ˜€

    Second!!

    All in favor?

    And you know I'm kidding.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thom A wrote:

    Brandie Tarvin wrote:

    Forget leading commas. Let's debate leading semi-colons. @=)

    .Please no >_< .Leading commas I accept as a preference, but leading semicolons are another matter entirely, lol .Those are like starting every sentence with a full stop, and not ending your last sentence with one

    THIS ^^^^^^^^^^^^^^^^^^^^^!!

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thom A wrote:

    Brandie Tarvin wrote:

    Forget leading commas. Let's debate leading semi-colons. @=)

    .Please no >_< .Leading commas I accept as a preference, but leading semicolons are another matter entirely, lol .Those are like starting every sentence with a full stop, and not ending your last sentence with one

    THIS ^^^^^^^^^^^^^^^^^^^^^!!

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Phil Parkin wrote:

    Brandie Tarvin wrote:

    Forget leading commas. Let's debate leading semi-colons. @=)

    This could start a flame war! I've seen instances of otherwise-seasoned coders on here using the dreaded

    ;WITH CTE AS (

    pattern, as if it's the right thing to do.

    A good friend, Aaron Bertrand, does it for all his demo scripts. However, he has a good reason (even if I don't agree). Because people are more than a bit ignorant about the use of semi-colons, for his examples, he always puts it at the front so that they can copy & paste it and it will always work. I think he's modelling bad behavior, like having SELECT * in example code (something I used to do). He disagrees. I'm not losing a friendship over it, but I do occasionally poke him on it.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey wrote:

    A good friend, Aaron Bertrand, does it for all his demo scripts. However, he has a good reason (even if I don't agree). Because people are more than a bit ignorant about the use of semi-colons, for his examples, he always puts it at the front so that they can copy & paste it and it will always work. I think he's modelling bad behavior, like having SELECT * in example code (something I used to do). He disagrees. I'm not losing a friendship over it, but I do occasionally poke him on it.

    I had a very similar, albiet it breif, conversation with him on this last year as well. I was on the same side as you, I don't agree with it, but I do understand why he does it.

    Honestly, it's more frustrating that when someone who "copy pastas" code from somewhere and gets the error Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon. That instead of reading the error (as the problem is literally spelt out in the it), they just proclaim that the code they're copied, and have not taken the time to understand, is wrong and broken. /sigh

    For someone that does provide as much content as he does/has, I can completely understand how that can wear away your sanity. ๐Ÿ˜‰

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Looks like I woke everyone up this morning. Heeeheee.

    @=)

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Thom A wrote:

    For someone that does provide as much content as he does/has, I can completely understand how that can wear away your sanity. ๐Ÿ˜‰

    Exactly. I totally understand why he does it and, as I said, I wouldn't damage a friendship over such trivial crap. However, I certainly do poke the bear on occasion. Meanest Canadian I know. Ha!

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thom A wrote:

    Brandie Tarvin wrote:

    Forget leading commas. Let's debate leading semi-colons. @=)

    .Please no >_< .Leading commas I accept as a preference, but leading semicolons are another matter entirely, lol .Those are like starting every sentence with a full stop, and not ending your last sentence with one

     

    /shrug I blame the interpreter for this.ย  SQL Server is perfectly happy with some statements not being terminated by a semi colon, including the very statements that require the previous statement to be terminated by a semi colon.ย  This effectively makes semi colons a statement beginner in some cases and not a true statement terminator.

  • I use

    ;WITH

    just to help prevent possible errors.ย  Sure, I could be technically correct and blame someone else when there was a problem with the code, but I prefer to avoid the problem altogether.ย  Someone making a quick fix in a proc sometimes just writes a line of code without fully examining all the other code around it -- because they don't need to do that to add their particular code fix.ย  Should they still use a ;?ย  Sure, but it's not always required so most people don't routinely code them.ย  I don't want a major client to have a problem in production because of something that trivial.ย  The time to parse an extra ; is so small it can't even be measured.

     

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • I prefer:

    ;


    -- ^
    -- |
    -- |
    -- semi colon above because most of you don't use them
    WITH mycte ....
  • I will admit, and though I know it shouldn't, it does amuse me when I see code that has something like this:

    SELECT *
    FROM dbo.MyTable MT ;WITH (NOLOCK)
    JOIN dbo.YourTable YT ;WITH (NOLOCK) ON MT.ID = YT.MTID

    Or even "better":

    SELECT *
    FROM (;WITH CTE AS(
    SELECT *,
    ROW_NUMBER() OVER (PARTITION BY SomeCol ORDER BY ID) AS RN
    FROM dbo.MyTable)
    SELECT *
    FROM CTE
    WHERE RN = 1) DT
    WHERE SomeCol > 5

    It's that some people seem to think it's a ;WITH clause, rather than just WITH with a statement "beginningator" that really sells me against the syntax.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • What I find extremely frustrating is when someone writes SQL code that joins multiple tables without prefixing the column names with their originating table or alias using dot notation. This adds a significant amount of time to the task of determining which columns belong to which tables.

  • Grant Fritchey wrote:

    Jeff Moden wrote:

    David Burrows wrote:

    Jeff Moden wrote:

    David Burrows wrote:

    Thatโ€™s why I like you Jeff, youโ€™re such a smart guy ย ๐Ÿ˜๐Ÿฅณ

    Heh... if I were really smart, I'd just up and retire.ย  That would probably kill me though.

    Just like me ๐Ÿ˜‚, glad I didnโ€™t. Youโ€™ll out live us all ๐Ÿ˜€ youโ€™re an institution you know ๐Ÿ˜ƒ

    I think most folks would say your confused, David.ย  They rather think I should be IN an institution. ๐Ÿ˜€ ๐Ÿ˜€ ๐Ÿ˜€

    Second!!

    All in favor?

    And you know I'm kidding.

    Kidding??? Why??? We were going to invite you to join us! ๐Ÿ˜€ ๐Ÿ˜€ ๐Ÿ˜€

    --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)

  • Jeff Moden wrote:

    Grant Fritchey wrote:

    Jeff Moden wrote:

    David Burrows wrote:

    Jeff Moden wrote:

    David Burrows wrote:

    Thatโ€™s why I like you Jeff, youโ€™re such a smart guy ย ๐Ÿ˜๐Ÿฅณ

    Heh... if I were really smart, I'd just up and retire.ย  That would probably kill me though.

    Just like me ๐Ÿ˜‚, glad I didnโ€™t. Youโ€™ll out live us all ๐Ÿ˜€ youโ€™re an institution you know ๐Ÿ˜ƒ

    I think most folks would say your confused, David.ย  They rather think I should be IN an institution. ๐Ÿ˜€ ๐Ÿ˜€ ๐Ÿ˜€

    Second!!

    All in favor?

    And you know I'm kidding.

    Kidding??? Why??? We were going to invite you to join us! ๐Ÿ˜€ ๐Ÿ˜€ ๐Ÿ˜€

    by the looks of it WE are ALL in one already (SSC)

Viewing 15 posts - 66,166 through 66,180 (of 66,738 total)

You must be logged in to reply to this topic. Login to reply