- UNIQUE:唯一索引
- CLUSTERED:聚集索引
- NONCLUSTERED:非聚集索引
1 use Sales 2 create table goods 3 ( 4 id int, 5 name char(20), 6 price float 7 ) 8 create index id_index on goods(id)
1 create unique clustered index name_index 2 on goods(name)
建立非聚集索引:create index aaa on goods(id asc, name desc)
创建分区索引:1 --创建分区索引 2 create nonclustered index index_nonclustered_part 3 on partitiontable(col1) 4 on ppss2(col1);
删除索引:(需指定表名)drop index name_index on goods