Company

Our Services

Our Clients

Articles

Paging in MS SQL Server

Published on: 04 October 2007 By: Nick Slater

Creating Page Numbers is easier with MYSQL. In MS-SQL Server there are many ways of paging data. The following method is simpler of all and works well with a few hundred thousand records in a table.

CODE:
SELECT myvalue, mydata
FROM
(
SELECT ROW_NUMBER()
OVER
(
ORDER BY myvalue ASC
)
AS Row, myvalue, mydata FROM table_1
)
AS BlogLimited
WHERE Row >= 90000 AND Row <= 90010







underline

View All Articles (Articles Archive)

 

Chapter Zero Limited, 2 Providence Court, Pynes Hill, Exeter, UK, EX2 5JL
Tel: +44 (0)1392 361500, Fax: +44 (0)1392 361501