/*--创建索引--*/
use stuDB
go
/*- 检测是否存在该索引,索引存放在系统表sysindexes中--*/
if exists(select name from sysindexes where name = 'IX_stuMarks_writtenExam')
drop index stuMarks.IX_stuMarks_writtenExam --删除索引
/*--笔试列创建非聚集索引,填充因子为30%--*/
create nonclustered index IX_stuMarks_writtenExam
on stuMarks(writtenExam)
with fillfactor =30
go
/*--指定案索引:IX_stuMarks_writtenExam查询--*/
select *from stuMarks(index=IX_stuMarks_writtenExam)
where writtenExam between 60 and 90
/*T_SQL语句创建视图-*/
use stuDB
go
if exists(select*from sysobjects where name ='view_stuInfo_stuMarks')
drop view view_stuInfo_stuMarks
go
错误提示:'index' 附近有语法错误。
请高手帮我看下那错了 那提示的是select *from stuMarks(index=IX_stuMarks_writtenExam) 这里面得index
谢谢了