This project is read-only.
1

Closed

Incorrect syntax near 'OFFSET'. Invalid usage of the option NEXT in the FETCH statement.

description

Sql Server 2008 db when paging data throw error is

Incorrect syntax near 'OFFSET'.
Invalid usage of the option NEXT in the FETCH statement.
Closed Jan 9, 2015 at 6:22 PM by RoMiller
EF Team Triage: This is by design, if the model is configured for 2012 then we will generate a query that is compatible with 2012 and the manifest token must be changed if you target an earlier version.

comments

ErikEJ wrote Dec 26, 2014 at 9:33 AM

Possibly a duplicate of https://entityframework.codeplex.com/workitem/2617 - ie check your providerManifest version in your edmx

divega wrote Dec 26, 2014 at 9:32 PM

ErikEJ is right. In EF 6.1.2 we started using OFFSET/FETCH for paging queries. This was a very popular feature request and the improvement ended up being provided by a contributor (see https://entityframework.codeplex.com/workitem/961 for the original work item).

If an application containing an EDMX file that was originally created against SQL Server 2012 is pointed to an older version of SQL Server, queries will fail because the ProviderManifestToken attribute in the EDMX are fixed to "2012".

This is by design, but rather than closing it immediately we should monitor how many people are hitting it and based on that consider if there is anything we should do differently about it.