sqlserver 插入或更新表常用 系统错误消息 整理
241 文字型转日期或时刻失败
242 数据库允许日期范围以外
244 超过InT最大值
245 varchar12.9555转int型失败
248 varchar转int超过最大值
547 check约束以外
515 NULL 不允许
2627 主键冲突
2714 对像已经存在(重复)
8114 类型转换错误
8115 型转换引算式溢出
8152 字符超过限定位数
测试用表
drop table Student
GO
CREATE TABLE Student(
Sno char(9) primary key,
Sname varchar(10) NOt null,
Ssex char(2) check (Ssex in(‘男’,’女’)),
Sage numeric(2,0) check(([Sage]>1 and [Sage]<100)),
Sdept char(4),
class int,
flg tinyint,
thirty numeric(15,4),
[start_date] datetime
)
GO
insert Student values(‘313’,’fan’,’男’,’1’,’6888’,2,’126’,’1000+04-13 25:05:27.000’,’1000+04-13 25:05:27.000’)
update Student set Sno=’’,Sname=’’,Ssex=’男’,Sage=99,Sdept=’8888’
还没有评论,来说两句吧...