有两种办法: 1. select top 10 * from tablename where ... select top 10 col1,col2,...coln from tablename where... 2. set rowcount 10 select * from tablename where ... select col1,col2,...coln from tablename where... set rowcount 0
select top 10 * from table 我就是这么写的压。
to:supsuccess(火气不小) set rowcount 10 可以运行,但是必须写到存储过程中去,得修改程序。 可不可以解释为什么top 10 不支持呢?
Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near '10'.
1.
select top 10 * from tablename where ...
select top 10 col1,col2,...coln from tablename where...
2.
set rowcount 10
select * from tablename where ...
select col1,col2,...coln from tablename where...
set rowcount 0
我就是这么写的压。
set rowcount 10 可以运行,但是必须写到存储过程中去,得修改程序。
可不可以解释为什么top 10 不支持呢?
Line 1: Incorrect syntax near '10'.