Trouble with INSERT INTO statement

前端 未结 1 1334
悲&欢浪女
悲&欢浪女 2021-01-24 16:00

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(         


        
相关标签:
1条回答
  • 2021-01-24 16:36

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

    INSERT INTO Events (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.

    0 讨论(0)
提交回复
热议问题