-排序(聚集索引)
create clustered index inx_entry_stock_bi on entry_stock_d(entry_stock_bi)
--创建非聚集索引
create nonclustered index inx_entry_stock_on entry_stock_d(entry_stock_bi)
--主键
alter table entry_stock_d add primary key nonclustered--主键且非聚集
(
entry_stock_bi,aid
)
创建主键时要保证原库中没有重复的主键数据,且主键不能为空,不能被其他的索引引用,如果存在,要先删除引用添加成功后再增加