pagination with sqlsrv driver #43549
Unanswered
crisleiria
asked this question in
Q&A
Replies: 2 comments 4 replies
-
Have you tried using
or the newer
|
Beta Was this translation helpful? Give feedback.
3 replies
-
Glad you worked it out! Might worth a PR to 9.x with a couple o ifs on the SQL server version? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear all,
I haven't found any solution yet, so if anyone has this problem let me know.
I have just upgrade laravel from 6 to 8 on all my laravel main production projects. But one detail was not is the docs, and this have big impact on my case.
I have SQL SERVER 2008 R2 on production and after update Laravel I start seing this error when eloquent is doing pagination:
I understand the problem, SQL SERVER has new functions to paginate after SQL SERVER 2012 and it seems that eloquent after laravel 7 use this new SQL function FETCH and NEXT.
This error appears when using this code:
$list = $query->skip($listsettings->page) ->take($listsettings->records) ->get();
I believe that will also occur on
paginate()
method (not tested yet).There is any option on the database.php file, specific to sqlsrv driver to implement the SQL SERVER 2008 pagination functions?
Upgrade SQL SERVER is not an option.. at least for now.
This detail should be in the upgrade docs I belieave, it has low impact, but it should be.
Thank in advance,
Cristovao Oliveira
Beta Was this translation helpful? Give feedback.
All reactions