我想把cus表中的词典插入到dd表中,老是出现这个错误:
消息 213,级别 16,状态 1,第 2 行
列名或所提供值的数目与表定义不匹配。
代码如下:
create database abc
on primary
(
name=abc_data,
filename='D:\1\abc_data.mdf',
size=3,
maxsize = unlimited ,
filegrowth=1
)
log on
(
name=abc_log,
filename='D:\1\abc_log.ldf',
size=1,
maxsize=20,
filegrowth=10%
)
create table cus(
cid char(8) not null,
cname varchar(8) null,
caddress varchar(30) null,
cphone char(11) not null,
primary key (cid)
)
create table dd(
cid char(8) not null,
gid char(10) not null,
tprice char(4) null,
primary key(cid,gid)
)
create table goods(
gid char(10) not null,
price char(5) null,
gaddress varchar(20) not null,
primary key(gid)
)
insert into cus
values('2018001','小周','福寿小区','10001'),
('2018002','小吴','幸福小区','10011'),
('2018003','小边','阳光小区','10002'),
('2018004','小张','幸福小区','10031'),
('2018005','小朴','阳光小区','10021'),
('2018006','小金','月亮小区','10051'),
('2018007','大金','月亮小区','10061')
*/
insert into goods
values('1001','100','重庆'),
('1002','200','山东'),
('1003','300','重庆'),
('1004','400','四川'),
('1005','500','山东'),
('1006','600','香港'),
('1007','600','上海'),
('1008','700','上海'),
('1009','800','内蒙古'),
('1010','900','甘肃')
insert into dd
select cid from cus
这是为什么呢,为什么插不进去呢?哪里的表定义不对呢?新手表示快要秃头。。。