用惯了delete语句是delete from tablename where ....
今天要强制使用某一个index,查了查sql server也可以像ORACLE一样用hint,在select语句中是
select * from tablename with(index(indexname)) where...
可在delete中用
delete from tablename with(index(indexname)) where ...
出错。Google了很久终于找到一篇:
原来要用
delete tablename from tablename with(index(indexname)) where ...
特此记录。