用惯了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了很久终于找到一篇:

http://social.msdn.microsoft.com/forums/en-US/transactsql/thread/32121714-97d8-4c92-8214-ecea4e7dc76a

原来要用

delete tablename from tablename with(index(indexname)) where ...

特此记录。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
猜你喜欢
  • 2021-06-04
  • 2021-11-24
  • 2021-08-23
  • 2022-02-11
  • 2022-12-23
  • 2021-08-18
相关资源
相似解决方案