1、首先打开软件,进入界面。
2、接下来通过SQL语句进行修改,如下图所示,指定表明和字段即可。
3、上述的SQL语句会默认将允许NULL值给勾上,如下图所示。
4、如果不想让NULL值默认勾选上的话,就在SQL语句后面加上not null条件即可。
5、最后在回到数据表的设计界面,就会看到字段长度已经增加,并且其他的数据条件没有变化。
alter table CS01 add constraint CK_A800 check (LEN(A8)=8)alter table CS01 add constraint CK_A8001 check (A8 like '00%')
alter table CS01 add constraint CK_A8003 check (ascii(substring(A8,3,1))>=48 and ascii(substring(A8,3,1))<=57)
alter table CS01 add constraint CK_A8004 check (ascii(substring(A8,4,1))>=48 and ascii(substring(A8,4,1))<=57)
--下划线是通配符
alter table CS01 add constraint CK_A8005 check (ascii(substring(A8,5,1))>=ascii('_'))
--只允许输入大写字母
alter table CS01 add constraint CK_A8006 check (ascii(substring(A8,6,1))>=65 and ascii(substring(A8,6,1))<=90)
alter table CS01 add constraint CK_A8007 check (ascii(substring(A8,7,1))>=65 and ascii(substring(A8,7,1))<=90)
alter table CS01 add constraint CK_A8008 check (ascii(substring(A8,8,1))>=65 and ascii(substring(A8,8,1))<=90)我也是菜鸟一个 这么写看着确实有点傻
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)