Server side pagination in Azure ( MS SQL ) -
how implement pagination in sql query in azure specific , how specify limit , offset ....
i supposed show 50 records per page , there 4000 records in database
i writing api same fetch records using sql query .... how specify in ms sql query
select * yourtable order someuniquecolumn offset 0 rows fetch next 50 rows ;
you can use variables below:
declare @pagenum int = 1, @pagesize int = 10; select * yourtable order someuniquecolumns offset (@pagenum - 1) * @pagesize rows fetch next @pagesize rows only;
references:
http://sqlmag.com/blog/sql-server-2012-t-sql-glance-offsetfetch
Comments
Post a Comment