I am using Sequelize with Tedious to access SQL Server 2008.
When I do sequelizeModel.findOne() , I get this exception -
Raw reject SequelizeDatabaseError: Incorrect use of the NEXT option in the FETCH statement.
I know that SQL Server 2008 does not support OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY , and therefore an exception is thrown.
But I also explicitly installed tdsVersion in the tedious 7_3_B options.
As described here -
http://pekim.imtqy.com/tedious/api-connection.html
I have tried all versions of tds, and the query syntax that is generated always contains the FETCH/NEXT syntax.
Am I missing something?
Should the syntax be specific to the tds version?
I also confirmed that the tdsVersion parameter tdsVersion successfully passed to the tedious connection library from sequelize.
An example of the generated query syntax is
SELECT [id], [FIRST_NAME], [LAST_NAME] FROM [USERs] AS [USERS] ORDER BY [id] OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY;
source share