T-SQL Syntax Gotchas

  • Sean of the Lynchmob

    Ten Centuries

    Points: 1038

    Thank you, a nice puzzle to work out first thing in the morning. Close, though, I had forgotten that 'COMPUTE' had been deprecated and had to think about that one.

    Thanks,

    Sean

  • Gazareth

    One Orange Chip

    Points: 27737

    Toreador (7/8/2014)


    Gazareth (7/8/2014)


    Toreador (7/8/2014)


    Being pedantic, only 3 of those statements return syntax errors...

    Are you running it on SQL 2008 R2 or earlier?

    Statement 6 is valid there but not on 2012 onwards.

    SQL2014.

    Statement 3 fails with "An object or column name is missing or empty...."

    The others fail with a syntax error.

    I did say I was being pedantic 😉

    Gotcha. I didn't parse your statement correctly 🙂

  • manik_anu

    SSCrazy

    Points: 2367

    I am running at sql server 2008 R2... for section 6 i didn't get any error....

    Manik
    You cannot get to the top by sitting on your bottom.

  • Sean Pearce

    SSCoach

    Points: 15750

    manik123 (7/15/2014)


    I am running at sql server 2008 R2... for section 6 i didn't get any error....

    The question states that the script was run against a 2012 instance. Section 6 will fail on 2012 and above.

    The SQL Guy @ blogspot[/url]

    @SeanPearceSQL

    About Me[/url]

  • PChiragS

    SSCarpal Tunnel

    Points: 4965

    nice question.

    thanks Sean.

Viewing 5 posts - 16 through 20 (of 20 total)

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