mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
MSODBCSQL17 and SQL Server 2008 findOneBy(): Incorrect syntax near 'OFFSET' #6947
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Adi-18 on GitHub (Mar 11, 2022).
Bug Report
Summary
Application that connects to a remote SQL Server 2008 R2 with MSODBCSQL17
and SQLSRV Doctrine DBAL driver in a Docker container running PHP-FPM 8.1 and Apache.
Using Doctrine to persist entities and retrieve one more than one record works without problems, but the findOneBy() method throws 1 DBAL exception and 1 SQLSRV Exception.
Current behavior
When retrieving entities with the default findOneBy() method, Symfony throws the following: Incorrect syntax near 'OFFSET'
Also follows don't works:
I need to select first row of my database.
Issue [ doctrine/dbal#3159] did not help or I don't understand it.
@Damien-Unsolite commented on GitHub (Apr 26, 2022):
Hi. Same problem for me.
It seems Doctrine 3 must be used now for SQLServer "version 2012 and above"
https://www.doctrine-project.org/projects/doctrine-dbal/en/3.2/reference/platforms.html
Doctrine 2 can use SQLServer 2000 and above.
That's very bad for me (and my project)...