SQL INSERT INTO

时间:2015-08-06 09:31:44

标签: sql sql-insert

我有以下查询: -

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   “FC03”附近的语法不正确。

任何人都可以帮助解决造成这种情况的原因,因为我必须遗漏一些明显的东西

感谢。

2 个答案:

答案 0 :(得分:3)

数量

附近有无与伦比的报价

尝试:

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);

答案 1 :(得分:2)

试试这个: -

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)