alter table cardInfo

alter table cardInfo
   add constraint PK_CID primary key (CID),     --主键约束,CID为主键
   constraint CK_CID check (CID like '1010 3576 [0-9][0-9][0-9][0-9] [0-9][0-9][0-9][0-9]'),  
   constraint DF_curType default ('RMB') for curType,
   constraint CK_savingType check(savingType in('活期','定活两便','定期')),
   constraint DF_openDate default(getDate()) for openDate,   --默认约束,当天日期
   constraint CK_openMoney check(openMoney>=1),
   constraint CK_balance check(balance>=1),
   constraint CK_pass check(len(pass)>=6),
   constraint DF_pass default('888888') for pass,
   constraint DF_IsReportLoss default(0) for IsReportLoss,
   constraint FK_CUID foreign key(CUID) references userInfo(UID) --主外键约束,CUID为外键
posted @ 2009-01-09 13:04  洗碗心得  阅读(263)  评论(0编辑  收藏  举报