Skip to content Skip to sidebar Skip to footer

Trouble With Insert Into Statement

I can't seem to figure out why I keep getting a Syntax error in INSERT INTO statement. The code is below. static void ABSChangeEventsTable(string ControlNumber, string CurrentStatu

Solution 1:

User is a reserved keyword, you need to wrap it in square brackets:

INSERTINTOEvents (Date_Time, Details, Regarding, [User], Control_Number) VALUES (@Date_Time, @Details, @Regarding, @User, @Control_Number)

I'd recommend renaming that column to avoid the need for square brackets every time you reference it.

Post a Comment for "Trouble With Insert Into Statement"