1.ID is the first page of digital or ordered characters, the next page, the next page can be available in the next page WHERE ID> = parameter value last page Select @ m = count (*) from table @ m = n% @ mselect top @m * from the table INTO # TMP1 Order by id descselect * from # Tmp1 Order By ID or SELECT * FROM table Where id not in (SELECT TOP X from table) 2.create proc getauthors @ Author_last_name As varchar (100) = null, @ Startrow as int = null, @ stoprow as int = NULLAS
---- Building a Table Variable Declare @t_Table Table ([Rownum] [INT] Identity (1, 1) PRIMARY NOTNTINTITY (1, 1), [VARCHAR], [VARCHAR], [VARCHAR] (20), [Phone] [25), [Address] [varchar] (40), [City] [varcha] (20), [State] [char] (2), [ZIP] [char] (5))
---- Stop processing query set rowcount @stoprow after returning the specified @stoprow row
---- Insert into the Table variable insert @T_TABLE ([Author_First_name], [Author_First_name], [Phone], [Address], "], [State], [ZIP]) SELECT [Author_Last_name], [Author_First_name], [Phone], [Address], [City], [State], [ZIP]
From authorswhere author_last_name like '%' @Author_last_name '%' Order by Author_Last_Name
---- Return to the correct result Select * from @T_Table where rownum> = @startroworder by rownum
Go