Subtle SQL Error
-
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 -
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 111111Harvey 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 -
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 -
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. CartainoBah! Andale Mono, is the only true path!
-
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 111111you 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