database icon indicating copy to clipboard operation
database copied to clipboard

Microsoft SQL Server 2012 SYNTAX ERROR

Open ghost opened this issue 9 years ago • 2 comments

Firstly, I would like to send many, many thanks to Davit to implement support of MSSQL. I found one important bug.

$this->context->table(...)->limit(100,10) generate bad syntaxt.

SELECT * FROM [table] OFFSET 10 ROWS FETCH NEXT 100 ROWS ONLY

This syntax works only, if I use order clausule, for example: SELECT * FROM [table] ORDER BY [id] DESC OFFSET 10 ROWS FETCH NEXT 100 ROWS ONLY

ghost avatar Dec 21 '15 09:12 ghost

Yes, it is known (and good) limitation.

dg avatar Dec 21 '15 10:12 dg

Logic tells me, that you have truth. I was customized the driver in previous Nette version, and if ordering is not set in context, ordering is set automatically from identity column. Thank you for fast answer :-) Have a nice day.

ghost avatar Dec 21 '15 11:12 ghost