I have sql query:
INSERT into ProjectFiles (Id,ProjectId,Index) VALUES (@Id,@ProjectId,@Index)
But when I try to insert object, it throws exception:
Incorrect syntax near 'Index'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax
I think it is about Index
, because sql have command index
. How can I say to sql, that it is my column?
Index
是一个关键词,所以你必须使用[]
如下所示
INSERT into ProjectFiles (Id,ProjectId,[Index]) VALUES (@Id,@ProjectId,@Index)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.