开发者

Msg 102, Level 15, State 1, Line 2 Incorrect syntax near ','

开发者 https://www.devze.com 2023-01-24 06:49 出处:网络
whats wrong with following query? insert into table values ( (1001749039, 2010-10-29, 6, 1015583, \'B-1002-PYA-001-CM\',

whats wrong with following query?

insert into table values (
(1001749039, 2010-10-29, 6, 1015583, 'B-1002-PYA-001-CM', 
 1062514, 2001422, 'y', 15.49, 2010-11-03, 'e', 2010-11-10, 3, 2010开发者_如何学编程-11-10 )


  1. To start with you have an extra (.

  2. You might want to use [Table] instead of table in your query(if your table name is "Table") as "Table" it is a sql keyword.

  3. And, it wouldn't throw an error but you might want to enclose your date fields in quotes i.e. use '2010-10-29' instead of 2010-10-29 as SQL would interpret 2010-10-29 as 1971 if not enclosed in single quotes.


You have 2 opening parenthesis and only 1 closing one, for starters.


Try this:

insert into table values(1001749039, '2010-10-29', 6, 1015583, 'B-1002-PYA-001-CM', 1062514, 2001422, 'y', 15.49, '2010-11-03', 'e', '2010-11-10', 3, '2010-11-10' )
0

精彩评论

暂无评论...
验证码 换一张
取 消