近期一个老系统改用SQL Server 2005数据库, 从原来的2000改为2005, 默认情况下启动出错:

Incorrect syntax near 'Index'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required.
SQL Server 兼容模式

SQL Server 兼容模式

 

SQL 语句中的table hint 中缺少with 关键字,查阅资料,得知sql server 2000中可以不用with 关键字,到2005及以后一定要用with 关键字。估计当时sql 语法书写不规范导致.

将对应数据库改为2000(80) 兼容模式,解决问题。

SQL Server 兼容模式

相关文章:

  • 2021-08-23
  • 2022-12-23
  • 2021-07-21
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
猜你喜欢
  • 2021-07-02
  • 2021-10-18
  • 2021-11-20
  • 2021-08-30
  • 2021-08-24
  • 2021-12-25
  • 2022-12-23
相关资源
相似解决方案