Create Table FAILED!?

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    I thought it was the max length problem.

  • Geoscrewed

    Old Hand

    Points: 343

    Yet another way to cheat... and learn some new languages in the process 😀

    SELECT *

    FROM sys.messages

    WHERE message_id = 2714

  • t.pratiksha

    Mr or Mrs. 500

    Points: 597

    status is showing blue in Sql server 2012 :p

  • Hany Helmy

    SSChampion

    Points: 13488

    Rich Weissler (12/30/2014)


    Hany Helmy (12/30/2014)


    Wow :w00t: 41% didn`t know about the "Extra comma in column list" will not prevent you from creating a table.

    I didn't. And after a few hundred "Incorrect syntax near ','" from Select statements with an extra trailing comma and learning not to put that extra comma in... I don't even feel bad about not knowing. 🙂

    It`s always good 2 learn new things 🙂

  • Hany Helmy

    SSChampion

    Points: 13488

    t.pratiksha (12/30/2014)


    status is showing blue in Sql server 2012 :p

    As mentioned in the explanation, it`s not a reserverd word although showing as blue.

  • Hany Helmy

    SSChampion

    Points: 13488

    Geoscrewed (12/30/2014)


    Yet another way to cheat... and learn some new languages in the process 😀

    SELECT *

    FROM sys.messages

    WHERE message_id = 2714

    and language_id = 1033 😉

  • Dana Medley

    SSCertifiable

    Points: 6764

    Rich Weissler (12/30/2014)


    Hany Helmy (12/30/2014)


    Wow :w00t: 41% didn`t know about the "Extra comma in column list" will not prevent you from creating a table.

    I didn't. And after a few hundred "Incorrect syntax near ','" from Select statements with an extra trailing comma and learning not to put that extra comma in... I don't even feel bad about not knowing. 🙂

    +1 Learned something today. 😀



    Everything is awesome!

  • Marcia J

    SSCertifiable

    Points: 5649

    I missed it, but at least I was in good company.

  • Toreador

    SSChampion

    Points: 11261

    Hany Helmy (12/30/2014)


    Wow :w00t: 41% didn`t know about the "Extra comma in column list" will not prevent you from creating a table.

    Why would you expect people to know this? It's sloppy coding. I only know it because it was mentioned in another QotD a while back 🙂

    I was expecting one of the available answers to be that the Drop Table failed because of a foreign key error.

  • Koen Verbeeck

    SSC Guru

    Points: 258975

    Great question, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • T.Ashish

    SSCarpal Tunnel

    Points: 4246

    ha ha ..... I missed it.

  • davoscollective

    SSCertifiable

    Points: 6355

    Toreador (1/2/2015)


    Hany Helmy (12/30/2014)


    Wow :w00t: 41% didn`t know about the "Extra comma in column list" will not prevent you from creating a table.

    Why would you expect people to know this? It's sloppy coding. I only know it because it was mentioned in another QotD a while back 🙂

    I was expecting one of the available answers to be that the Drop Table failed because of a foreign key error.

    I didn't know you could do this either, but I disagree that it's sloppy coding. It's actually more balanced visually, makes it really easy when you are using dynamic SQL or some other language to generate SQL (don't have to treat the last column definition in a special way, or worry about a constraint or key definition needing a comma prior or not).

    It's also allowed in c#, for example in an enumeration.

    I would have failed first day as Steve's intern!

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    All good lessons on this one. Thanks for detailing them all out.

Viewing 13 posts - 16 through 28 (of 28 total)

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