sql server中翻页存储过程:
Create PROC blog_GetPagedPosts
(
@PageIndex int,
@PageSize int,
@BlogID int=0,
@PostType int=-1,
@CategoryID int=-1,
@Hiding bit =0,
@Count int output
)
as
DECLARE @PageLowerBound int
DECLARE @PageUpperBound int
SET @PageLowerBound = @PageSize * @PageIndex - @PageSize
SET @PageUpperBound = @PageLowerBound + @PageSize + 1
Create Table #IDs
(
TempID int IDENTITY (1, 1) NOT NULL,
EntryID int not null
)
Insert into #I...[ 查看全文 ]