gpt4 book ai didi

sql-server - SQL Server 2000 "Select is broken"带有 TOP 子句

转载 作者:行者123 更新时间:2023-12-04 07:02:42 25 4
gpt4 key购买 nike

使用 SQL Server 2000 Developer Edition,为什么会出现这样的代码:

select top 10 * from table

导致这个错误:

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '10'.



和这个代码:
select * from master m
left join locality l on m.localityid = l.localityid

导致这个错误:

Server: Msg 170, Level 15, State 1, Line 2 Line 2: Incorrect syntax near 'left'.

最佳答案

答案是数据库兼容性。它被设置为 60,应该是 80。

这是来自 http://msdn.microsoft.com/en-us/library/bb510680.aspx 的摘录

The value must be one of the following:
- 80 = SQL Server 2000
- 90 = SQL Server 2005
- 100 = SQL Server 2008



我把它改成 80,现在一切都很好。

关于sql-server - SQL Server 2000 "Select is broken"带有 TOP 子句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1599571/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com