Create Table FAILED!?

  • I thought it was the max length problem.

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

    SELECT *

    FROM sys.messages

    WHERE message_id = 2714

  • status is showing blue in Sql server 2012 :p

  • 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 🙂

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • 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.

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • 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 😉

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • 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!

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

  • 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.

  • Great question, thanks.

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

  • ha ha ..... I missed it.

  • 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!

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

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

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