elsa-core
elsa-core copied to clipboard
Using Elsa 2.15 in. net9 and encountering errors in SQL Server 2012
Incorrect syntax near 'OFFSET'. Invalid usage of the option NEXT in the FETCH statement.
Thanks for reporting this!
The error you're seeing:
Incorrect syntax near 'OFFSET'.
Invalid usage of the option NEXT in the FETCH statement.
...typically happens when the database is running in an older compatibility mode that doesn't support the OFFSET ... FETCH NEXT syntax used by EF Core 9 for pagination. Although you're using SQL Server 2012, it's likely that the compatibility level of your database is set lower than 110 (e.g., 100, which corresponds to SQL Server 2008).
To resolve this, you can update the compatibility level of your database to 110 by running the following SQL command:
ALTER DATABASE [YourDatabaseName] SET COMPATIBILITY_LEVEL = 110;
You can verify the current compatibility level with:
SELECT compatibility_level
FROM sys.databases
WHERE name = 'YourDatabaseName';
Alternatively, you could take control by generating your own EF Core migrations tailored to your environment.
Let us know if that helps!