34,874
社区成员
发帖
与我相关
我的任务
分享create table test
(
HotelId int primary key not null,
CityId int ,
HotelName varchar(50)
constraint U_Test unique(CityId,HotelName)--生成唯一约束时,自动生成唯一索引
)
--或
create table test
(
HotelId int primary key not null,
CityId int ,
HotelName varchar(50)
)
create unique index U_test on test(CityId,HotelName)
create table test
(
HotelId int primary key not null,
CityId int unique,
HotelName varchar(50) unique
)