sql约束 sql创建索引
1、alter table testTB add constraint U_check check(birthday<=getdate())
这句话就约束了出生日期必须小于等于今天,也可以在建表的时候写在最后为 check(birthday<=getdate())
2、创建索引
1 create unique index idx_id_birthday 2 on testTB(ID,birthday)
1、alter table testTB add constraint U_check check(birthday<=getdate())
这句话就约束了出生日期必须小于等于今天,也可以在建表的时候写在最后为 check(birthday<=getdate())
2、创建索引
1 create unique index idx_id_birthday 2 on testTB(ID,birthday)