--------------------------------
---------索引操作---------------
--------------------------------
use stuDB
go
--创建索引
if exists (select * from sysindexes where [name] ='ix_stuMarks_writtenExam' )
drop index stuMarks.ix_stuMarks_writtenExam
--create unique(唯一索引)、clustered(聚集索引)、nonclustered(非聚集索引)
create nonclustered index ix_stuMarks_writtenExam
on stuMarks (writtenExam)
with fillfactor=30--索引页填满的空间所占百分比
go
select * from stuMarks
with(index=ix_stuMarks_writtenExam)
where writtenExam>60
gosql 索引(index)
最新推荐文章于 2025-01-03 17:30:47 发布
本文介绍了一种在SQL中创建非聚集索引的方法,并演示了如何利用该索引进行高效的数据查询。通过实例展示了创建索引的过程及如何指定索引的填充因子。
1933

被折叠的 条评论
为什么被折叠?



