Closed gm42 closed 6 years ago
See also: https://github.com/sequelize/sequelize/issues/4404
The problem seems to be that an ORDER BY
is always necessary. Also, this functionality (FETCH
) is specific to recent versions of MSSQL.
See also: https://technet.microsoft.com/en-us/library/gg699618(v=sql.110).aspx#Anchor_2
Sorry for this, but only MSSQL 2017+ are officially supported, as this is the only version that supports docker image and could be tested with our CI https://app.wercker.com/Jinzhu/gorm/runs
Thank you for your report.
For the records, this error can also be caused by invalid escape sequences.
What version of Go are you using (
go version
)?Which database and its version are you using?
MSSQL 2012+
What did you do?
Please provide a complete runnable program to reproduce your issue.
Rationale
It is not possible to fetch 0 rows from what I can see with MSSQL 2012 and 2014. The fix to #1205 is not enough, apparently.
If you try to fetch 1 row, no error is returned.
The error is:
If you try with MSSQL 2014+ instead:
(Test here: http://rextester.com/BSLOL96705)