转自 <SQL Server 创建索引的 5 种方法> 地址:https://www.cnblogs.com/JiangLe/p/4007091.html 前期准备: create table Employee ( ID int not null primary key, Name nvarchar(4), Credit_Card_ID varbinary(max)); --- 小心这种数据类型. go 说
SQL Server 创建唯一约束sql语句 语句示例: 在创建表是时同时创建, 创建id,name,sex三个字段的唯一索引 create table t1( id int primary key,name varchar(50) not null,sex int not null,constraint un_id_time unique(id,name,sex)) 另下一种写法 create unique index u_index on table(id,name,sex)