永发信息网

SQL中插入时出现:将截断字符串或二进制数据。急需解决

答案:1  悬赏:60  手机版
解决时间 2021-07-29 13:32
  • 提问者网友:蓝琪梦莎
  • 2021-07-29 03:29

create table tbl_customer
(
customerID char(18) not null primary key check(len(customerID)=18 ),
customerName varchar(20) not null,
customerMobile char(11) unique check(len( customerMobile)=11 ), check( customerMobile like '1[3,5,8]%') ,
customerGender char(2) default('男') not null,
customerBirthday datetime,
customercountry varchar(15),
customercity varchar(15),
customerzipcode char(6),
customerVip char(1) default('否')


)

insert into tbl_customer (customerID,customerName)values ('330125468654213624','张杰')
insert into tbl_customer values ('330522198101016528','张三','13567882628','男','1986-06-18','china','杭州',null,'是')
insert into tbl_customer values ('330437199211256321','李四','13831525856','女','1995-06-01','china','江苏','301425','否')
insert into tbl_customer values ('336514199903086528','山鸡','15035214517','男','1975-03-18',' USA','Seattle',null,'是')

最佳答案
  • 五星知识达人网友:野慌
  • 2021-07-29 04:45

customerVip char(1) default('否')


应该是这个的问题吧


char表示非unicode字符,那么一个汉字应该是char(2)

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯