Tedious or Sequelize uses the wrong syntax for `findOne()`

前端 未结 6 1028
青春惊慌失措
青春惊慌失措 2021-02-06 08:51

I am using Sequelize with Tedious to access SQL Server 2008.

When I do a sequelizeModel.findOne() I get this exception -

Unhandled

6条回答
  •  名媛妹妹
    2021-02-06 09:47

    I'm using select @@version ->

    Microsoft SQL Server 2014 - 12.0.2000.8 (X64) 
        Feb 20 2014 20:04:26 
        Copyright (c) Microsoft Corporation
        Express Edition (64-bit) on Windows NT 6.3  (Build 17134: ) (Hypervisor)
    

    and got this same error. sequelize.authenticate() didn't fix it.

    See also: https://github.com/tediousjs/tedious/issues/872

    For me, the root cause. Basically, you need an ORDER BY for the OFFSET to make sense. @prayag answer above adds that ORDER BY.

提交回复
热议问题