尝试创建此数据库时,为什么总是收到此查询错误?

时间:2019-01-28 15:38:23

标签: sql-server ddl

我尝试过在线查看,但仍然继续运行此问题

CREATE TABLE CANDYINVENTORY
(
     CANDY CHAR(40),
     SOLD INT
);

INSERT INTO CANDYINVENTORY (CANDY, SOLD)
VALUES('POLARICE', 1);

无法执行查询。

  

错误:数据库中已经有一个名为“ CANDYINVENTORY”的对象。

2 个答案:

答案 0 :(得分:0)

您已经在系统中创建的表现在只需执行插入查询

INSERT INTO CANDYINVENTORY
(CANDY, SOLD)
VALUES('POLARICE',1);

答案 1 :(得分:0)

您不需要每次都运行create table查询。创建表后,只需执行插入。

2019-01-28T17:28:33.110+0200: 581034.609: [GC (Allocation Failure) [PSYoungGen: 1119222K->67783K(1138688K)] 2164025K->1112686K(3585536K), 0.0536302 secs] [Times: user=0.12 sys=0.01, real=0.05 secs] 
2019-01-28T17:28:45.279+0200: 581046.778: [GC (Allocation Failure) [PSYoungGen: 1121991K->66684K(1121280K)] 2166894K->1113172K(3568128K), 0.0811001 secs] [Times: user=0.19 sys=0.00, real=0.09 secs] 
2019-01-28T17:29:23.290+0200: 581084.788: [GC (Allocation Failure) [PSYoungGen: 1120892K->67269K(1138176K)] 2167380K->1113997K(3585024K), 0.0448303 secs] [Times: user=0.12 sys=0.00, real=0.04 secs] 
2019-01-28T17:29:52.217+0200: 581113.715: [GC (Allocation Failure) [PSYoungGen: 1121477K->70537K(1138176K)] 2168205K->1118105K(3585024K), 0.0427560 secs] [Times: user=0.13 sys=0.00, real=0.04 secs] 
2019-01-28T17:30:13.902+0200: 581135.401: [GC (Allocation Failure) [PSYoungGen: 1124745K->65334K(1136640K)] 2172313K->1121687K(3583488K), 0.0465384 secs] [Times: user=0.14 sys=0.00, real=0.05 secs] 
2019-01-28T17:30:40.927+0200: 581162.426: [GC (Allocation Failure) [PSYoungGen: 1120054K->59715K(1137664K)] 2176407K->1120871K(3584512K), 0.0420487 secs] [Times: user=0.12 sys=0.00, real=0.05 secs]