日期:2014-05-17 浏览次数:20513 次
create proc usp_GetAllLogsSelect_Pages
@Category int,
@Visible int,
@Uname varchar(50),
@PageSize int,
@PageIndex int
AS
declare @x int,@y int
set @x=(@PageIndex-1)*@PageSize+1
set @y=(@PageIndex)*@PageSize
exec ('select* from(
select ROW_NUMBER() over(order by ReleaseTime desc) as Rownum,
LId,LogName,Abstract,CommentNo,ReadNo,UName,Category,ReleaseTime
from Logs
where Category='+@Category+' and Visible='+@Visible+' and Uname like '+@Uname+')
as log
where Rownum between '+@x+' and ' +@y)
alter proc usp_GetAllLogsSelect_Pages
AS
begin
declare @Category int,
@Visible int,
@Uname varchar(50),
@PageSize int,
@PageIndex int,
@x int,
@y int
set @x=(@PageIndex-1)*@PageSize+1
set @y=(@PageIndex)*@PageSize
exec ('select* from(
select ROW_NUMBER() over(order by ReleaseTime desc) as Rownum,
LId,LogName,Abstract,CommentNo,ReadNo,UName,Category,ReleaseTime
from Logs
where Category='+@Category+' and Visible='+@Visible+' and Uname like '+@Uname+')
as log
where Rownum between '+@x+' and ' +@y)
end