Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Clever Code
  4. Subtle SQL Error

Subtle SQL Error

Scheduled Pinned Locked Moved Clever Code
csharpdatabasehelpquestion
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Harvey Saayman
    wrote on last edited by
    #1

    I was just adding a very simple table to an existing db... here's the code

    CREATE TABLE LogMessageType
    {
    ID INT IDENTITY(0, 1) NOT NULL,
    LogMessageType VARCHAR(100) NOT NULL,

    CONSTRAINT    PK\_LogMessageTypeID   PRIMARY KEY(ID),
    CONSTRAINT    UQ\_LogMessageType     UNIQUE(LogMessageType)
    

    }

    I kept on getting an Incorrect syntax near '{'. message and i couldn't figure out what the hell SQL's complaining about... And just as i started to question my sanity after staring at this for 15 minutes... i realized i was using curly brackets instead of normal ones :-O I code with the Courier New font @ a size of 8 @ a screen resolution of 1280 X 1024, the difference between a ( and a { is hardly noticeable!! Hows that for subtle :rolleyes:

    Harvey Saayman - South Africa Junior Developer .Net, C#, SQL you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer) 1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111

    R J S 3 Replies Last reply
    0
    • H Harvey Saayman

      I was just adding a very simple table to an existing db... here's the code

      CREATE TABLE LogMessageType
      {
      ID INT IDENTITY(0, 1) NOT NULL,
      LogMessageType VARCHAR(100) NOT NULL,

      CONSTRAINT    PK\_LogMessageTypeID   PRIMARY KEY(ID),
      CONSTRAINT    UQ\_LogMessageType     UNIQUE(LogMessageType)
      

      }

      I kept on getting an Incorrect syntax near '{'. message and i couldn't figure out what the hell SQL's complaining about... And just as i started to question my sanity after staring at this for 15 minutes... i realized i was using curly brackets instead of normal ones :-O I code with the Courier New font @ a size of 8 @ a screen resolution of 1280 X 1024, the difference between a ( and a { is hardly noticeable!! Hows that for subtle :rolleyes:

      Harvey Saayman - South Africa Junior Developer .Net, C#, SQL you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer) 1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111

      R Offline
      R Offline
      Robert C Cartaino
      wrote on last edited by
      #2

      Harvey Saayman wrote:

      I code with the Courier New font @ a size of 8 @ a screen resolution of 1280 X 1024, the difference between a ( and a { is hardly noticeable!!

      I've been there. If you have ClearType font smoothing turned on, try switching to Consolas for your monospaced programming font. Without font smoothing, Consolas has a lot of problems. When you have ClearType turned on, a lot of the font details are obscured in Courier New. So Consolas was designed with font-smoothing and programming in mind. I think it is going to become the de facto standard as programmers move to Vista and beyond. Jump into Word and type { } in both Courier New and Consolas. Even at 8 point, you can see the added definition. Enjoy, Robert C. Cartaino

      P 1 Reply Last reply
      0
      • H Harvey Saayman

        I was just adding a very simple table to an existing db... here's the code

        CREATE TABLE LogMessageType
        {
        ID INT IDENTITY(0, 1) NOT NULL,
        LogMessageType VARCHAR(100) NOT NULL,

        CONSTRAINT    PK\_LogMessageTypeID   PRIMARY KEY(ID),
        CONSTRAINT    UQ\_LogMessageType     UNIQUE(LogMessageType)
        

        }

        I kept on getting an Incorrect syntax near '{'. message and i couldn't figure out what the hell SQL's complaining about... And just as i started to question my sanity after staring at this for 15 minutes... i realized i was using curly brackets instead of normal ones :-O I code with the Courier New font @ a size of 8 @ a screen resolution of 1280 X 1024, the difference between a ( and a { is hardly noticeable!! Hows that for subtle :rolleyes:

        Harvey Saayman - South Africa Junior Developer .Net, C#, SQL you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer) 1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111

        J Offline
        J Offline
        jeffwask
        wrote on last edited by
        #3

        Same here... I was staring at the screen forever trying to figure out what I was doing wrong.

        1 Reply Last reply
        0
        • R Robert C Cartaino

          Harvey Saayman wrote:

          I code with the Courier New font @ a size of 8 @ a screen resolution of 1280 X 1024, the difference between a ( and a { is hardly noticeable!!

          I've been there. If you have ClearType font smoothing turned on, try switching to Consolas for your monospaced programming font. Without font smoothing, Consolas has a lot of problems. When you have ClearType turned on, a lot of the font details are obscured in Courier New. So Consolas was designed with font-smoothing and programming in mind. I think it is going to become the de facto standard as programmers move to Vista and beyond. Jump into Word and type { } in both Courier New and Consolas. Even at 8 point, you can see the added definition. Enjoy, Robert C. Cartaino

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Bah! Andale Mono, is the only true path!

          1 Reply Last reply
          0
          • H Harvey Saayman

            I was just adding a very simple table to an existing db... here's the code

            CREATE TABLE LogMessageType
            {
            ID INT IDENTITY(0, 1) NOT NULL,
            LogMessageType VARCHAR(100) NOT NULL,

            CONSTRAINT    PK\_LogMessageTypeID   PRIMARY KEY(ID),
            CONSTRAINT    UQ\_LogMessageType     UNIQUE(LogMessageType)
            

            }

            I kept on getting an Incorrect syntax near '{'. message and i couldn't figure out what the hell SQL's complaining about... And just as i started to question my sanity after staring at this for 15 minutes... i realized i was using curly brackets instead of normal ones :-O I code with the Courier New font @ a size of 8 @ a screen resolution of 1280 X 1024, the difference between a ( and a { is hardly noticeable!! Hows that for subtle :rolleyes:

            Harvey Saayman - South Africa Junior Developer .Net, C#, SQL you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer) 1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111

            S Offline
            S Offline
            StevenWalsh
            wrote on last edited by
            #5

            you have an entire table for what is essentially 1 column?

            Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer. -Fred Brooks

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups