标签:code type logs page ges char style arch nbsp
alter proc proc_getpage @tbname varchar(20), @field varchar(200)=‘*‘, @orderfield varchar(20), @ordertype char(20)=‘asc‘, @pagesize int , @pageindex int, @strWhere varchar(500)=‘‘ as begin declare @sql varchar(max) if(@strWhere<>‘‘) set @strWhere=‘ where‘+@strWhere set @sql=‘select * from (select ROW_NUMBER()over(order by ‘+@orderfield+‘ ‘+@ordertype+‘) as pos, ‘+@field+‘ from ‘+@tbname+‘ ‘+@strWhere+‘ )as t where pos between ‘+str((@pageindex-1)*@pagesize+1)+‘ and ‘+str(@pagesize*@pageindex) exec( @sql) end
标签:code type logs page ges char style arch nbsp
原文地址:http://www.cnblogs.com/ang-664455/p/7109766.html