我创建索引的语句如下
create nonclustered index IX_transInfo_cardID
on transInfo(cardID)
with fillfactor=70
select * from transInfo (INDEX=IX_transInfo_cardID) where cardID='1010 3576 1212 1134'
cardID是transInfo表的外键
遇到的问题如下
Msg 1018, Level 15, State 1, Line 7
Incorrect syntax near 'INDEX'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax.
...全文
1549打赏收藏
创建索引时遇到的问题
我创建索引的语句如下 create nonclustered index IX_transInfo_cardID on transInfo(cardID) with fillfactor=70 select * from transInfo (INDEX=IX_transInfo_cardID) where cardID='1010 3576 1212 1134' cardID是transInfo表的外键 遇到的问题如下 Msg 1018, Level 15, State 1, Line 7 I
[Quote=引用 2 楼 yang_ 的回复:]
SQL codeselect*from transInfowith (INDEX=IX_transInfo_cardID)where cardID='1010 3576 1212 1134'
[/Quote]
用了这句后又有这样的错误
Msg 308, Level 16, State 1, Line 7
Index 'IX_transInfo_cardID' on table 'transInfo' (specified in the FROM clause) does not exist.