-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] SqlServer2012 grammar file #7568
Comments
Any thoughts? |
Well, that "should" be pretty easy. In SqlServerGrammar.php: protected function compileOffset(Builder $query, $offset)
{
return "OFFSET {$offset} ROWS";
}
protected function compileLimit(Builder $query, $limit)
{
return "FETCH {$limit} ROWS ONLY";
} The thing is, that OFFSET can be used alone, but FETCH needs a leading OFFSET Clause in order to work. Also, the used SQL Server Version should be specified in the Database.php config file in order to avoid conflicts, since this OFFSET Syntax has just been introduced in SQL Server 2012 (which is in version terms, 11.0). |
We're open to PRs. |
I attempted to implement OFFSET...FETCH but it only take effect when Gist: https://gist.github.com/yansern/4d7017351314eb37fa0df284ccd51c40 This is for the file: Perhaps this can be a starting point for others to follow. |
That implements limit and offset with sql server 2012's: OFFSET AND FETCH instead of row_number() over
The text was updated successfully, but these errors were encountered: