Incorrect syntax near the keyword 'User'

前端 未结 2 1747
春和景丽
春和景丽 2020-12-11 23:42

The error is:

An unhandled exception of type \'System.Data.SqlClient.SqlException\' occurred in System.Data.dll
Additional information: Incorrec

2条回答
  •  孤城傲影
    2020-12-12 00:19

    User is a built-in function in SQL Server. You need to surround the name with square brackets: [User]. This goes for all table names and other user-defined names that happen to collide with keywords, reserved words or built-in names, so I suspect you will need to write [Order] as well, since ORDER is an SQL keyword.

提交回复
热议问题