Odd SQL Server Error message

This one took me a few minutes to figure out. “Incorrect syntax near ‘@P2’. “. At first I thought my Colfusion server was having an issue with an email address I was inserting but the “P2” was not in the data at all. I finally discovered that my insert statement was missing the comma for the 2nd Parameter.

Insert into mytable
values (‘p1’
‘p2’
, ‘p3’
, ‘p4’
etc..

Cup size   
Select size then click on coffee cup.
This entry was posted in Problems & Fixes, SQL and tagged , . Bookmark the permalink.