SQL 插入
SQL INSERT INTO
我有以下查询:-
CREATE TABLE #FCO3
(TYPE_CODE varchar (100),
SKU varchar (100),
QtyOnHand int);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005060','1);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005066','8);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005067','1);
它抛出了一个错误:
Msg 102, Level 15, State 1, Line 109
Incorrect syntax near 'FC03'.
任何人都可以帮助解决造成这种情况的原因,因为我一定遗漏了一些明显的东西
谢谢。
您对数量的报价不匹配
尝试:
CREATE TABLE #FCO3
(TYPE_CODE varchar (100),
SKU varchar (100),
QtyOnHand int);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005060',1);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005066',8);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005067',1);
试试这个:-
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005060',1);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005066',8);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005067',1)
我有以下查询:-
CREATE TABLE #FCO3
(TYPE_CODE varchar (100),
SKU varchar (100),
QtyOnHand int);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005060','1);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005066','8);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005067','1);
它抛出了一个错误:
Msg 102, Level 15, State 1, Line 109 Incorrect syntax near 'FC03'.
任何人都可以帮助解决造成这种情况的原因,因为我一定遗漏了一些明显的东西
谢谢。
您对数量的报价不匹配
尝试:
CREATE TABLE #FCO3
(TYPE_CODE varchar (100),
SKU varchar (100),
QtyOnHand int);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005060',1);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005066',8);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005067',1);
试试这个:-
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005060',1);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005066',8);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005067',1)