sql分页
declare @currentPageIndex int
set @currentPageIndex=3
select top 5 * from (select row_number() over(order by getdate() desc) as rownumber,* from test) as temp_table
where rownumber>5*(@currentPageIndex-1)
创建大量数据测试
create table test
( id int identity(1,1),
data int null
)
begin tran
declare @index int set @index=0
while(@index <100000)
begin
insert into test(data) values(FLOOR(RAND(abs(checksum(newid())))*1000))
set @index=@index+1
end
commit
转载 请注明原文地址并标明转载:http://www.cnblogs.com/laopo
商业用途请与我联系:lcfhn168@163.com