SQL SERVER – Server Side Paging in SQL Server CE (Compact Edition)

SQL Server Denali is coming up with new T-SQL of Paging. I have written about the same earlier.

SQL SERVER – Server Side Paging in SQL Server Denali – A Better Alternative
SQL SERVER – Server Side Paging in SQL Server Denali Performance Comparison
SQL SERVER – Server Side Paging in SQL Server Denali – Part2

What is very interesting is that SQL Server CE 4.0 have the same feature introduced. Here is the quick example of the same. To run the script in the example, you will have to do install Webmatrix 4.0 and download sample database. Once done you can run following script.

SELECT *
FROM [Order Details]
ORDER BY [Order ID]
OFFSET 20 ROWS
FETCH NEXT 7 ROWS ONLY

Above script returns records 21 to 27 from the tables [Order Details]. OFFSET clause will skip the first 20 rows and then returns 7 rows. Please note, this T-SQL will throw error if ORDER BY is not used in the query.

I have found exactly similar post written by Jacob Sebastian on BeyondRelational.

Reference: Pinal Dave (http://blog.SQLAuthority.com)

About these ads

5 thoughts on “SQL SERVER – Server Side Paging in SQL Server CE (Compact Edition)

  1. This is very nice feature.

    But why do I need to install webmatrix4.0? what is the relation between T-SQL and webmatrix4.0?

    I have checked this feature in sql server 2008 EE. It is not working. I dont have webmatrix4.0 on my machine.

    Thank you

  2. Pingback: SQL SERVER – Download Microsoft SQL Server Compact 4.0 SP1 « SQL Server Journey with SQL Authority

  3. Pingback: SQL SERVER – Weekly Series – Memory Lane – #050 | Journey to SQL Authority with Pinal Dave

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s