I am using Sequelize with Tedious to access SQL Server 2008.
When I do a sequelizeModel.findOne()
I get this exception -
Unhandled
If you can change the sequelize library in node modules. Please follow the steps: Goto Node_modules -> sequelize ->lib -> mssql -> query-generator.js
You will find this line :
fragment += ` OFFSET ${this.escape(offset)} ROWS`;
Add a line above it :
fragment += ` ORDER BY ${this.quoteTable(options.tableAs || model.name)}.${this.quoteIdentifier(model.primaryKeyField)}`;
This should look like :
fragment += ` ORDER BY ${this.quoteTable(options.tableAs || model.name)}.${this.quoteIdentifier(model.primaryKeyField)}`;
fragment += ` OFFSET ${this.escape(offset)} ROWS`;