procedure [dbo].[GetAllBooks] 
(@pagesize int,
@pageindex int)
as
begin
 with temptbl as (
SELECT ROW_NUMBER() OVER (ORDER BY ID desc)AS Row, ID,BMID,MXNAME,MXZW,SHUHAO,SHICHANGJIA,HUIYUANJIA,MXSMALLPHOTOURL from T_MX 
)
 SELECT * FROM temptbl where Row between (@pageindex-1)*@pagesize+1 and (@pageindex-1)*@pagesize+@pagesize
end