求救各位高手
本人变了一个表 可是在插入数据时却出现了如下错误 :消息 8152,级别 16,状态 14,第 1 行将截断字符串或二进制数据。
语句已终止。
编写表如下:
create database Factory
use factory
CREATE TABLE S
(
sno char(4)not null primary key ,
sname varchar(8) not null,
sage smallint,
swage char(6),
sdepartments char(2),
sphone char(10),
soffice char(6)
);
insert into s(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('1001','郑俊华',26,'1000',1,'8001234','1201#');
insert into s(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('1002','王平',27,'1200',1,'8001234','1201#');
insert into s(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('2001','王晓华',38,'1300',2,'8001235','2302#');
insert into s(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('2002','李力',24,'800',2,'8001236','2303#');
insert into s(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('3001','黎远军',42,'1300',3,'8001237','1202#');
insert into s(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('4001','李源',24,'800',4,'8001245','2402#');
insert into s(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('4002','李兴明',36,'1200',4,'8001246','2103#'); “将截断字符串或二进制数据” 这个代表你所插入的元组某个值超过了你之前建表时定义的属性长度 insert into S(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('1001','郑俊华',26,'1000','1','8001234','1201#')
insert into S(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('1002','王平',27,'1200','1','8001234','1201#')
insert into S(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('2001','王晓华',38,'1300','2','8001235','2302#')
insert into S(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('2002','李力',24,'800','2','8001236','2303#')
insert into S(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('3001','黎远军',42,'1300','3','8001237','1202#')
insert into S(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('4001','李源',24,'800','4','8001245','2402#')
insert into S(sno,sname,sage,swage,sdepartments,sphone,soffice)
values('4002','李兴明',36,'1200','4','8001246','2103#')
页:
[1]