SQL中怎么创建非聚集索引

2025-03-13 03:39:30
推荐回答(1个)
回答1:

--创建非聚集索引
create nonclustered index inx_entry_stock_on entry_stock_d(entry_stock_bi)


延伸:

--创建聚集索引
create clustered index inx_entry_stock_bi on entry_stock_d(entry_stock_bi)

--主键
alter table entry_stock_d add primary key nonclustered--主键且非聚集
( entry_stock_bi,aid)