Create table FavoriteDish
(
FavID int identity (1,1) primary key not null,
DishID int references Dishes(DishID) not null ,
CelebrityName nvarchar(100) nonclustered not null
)
这导致
关键字“nonclustered”附近的语法不正确。
我参考了 MSDN 帮助来了解创建表语法。我不确定这里出了什么问题。
在线书籍的帮助实际上提到了关键字 CLUSTERED,但它仅与 UNIQUE 或 PRIMARY KEY 约束相关。这两个约束都会创建一个索引,您可以指定该索引是聚集索引还是非聚集索引。
您不能使用该语法来创建标准非聚集索引。
Create table FavoriteDish
(
FavID int identity (1,1) primary key not null,
DishID int references Dishes(DishID) not null ,
CelebrityName nvarchar(100) constraint ux_CelebrityName unique NONCLUSTERED not null
)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)