-
Notifications
You must be signed in to change notification settings - Fork 11.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[11.x] Use Default Schema Name on SQL Server #50855
[11.x] Use Default Schema Name on SQL Server #50855
Conversation
Thanks for submitting a PR! Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
Hi, @hafezdivandari Is it possible to set the default schema for SQLSRV now using config/database.php Thanks!!! |
Hi @peterpeep, afaik SQL Server doesn't support setting default schema when establishing a connection (unlike PostgreSQL). The only way is to use |
Fixes #50842
On SQL Server,
Schema
methods were always usingdbo
schema as default. This causes problem in a rare condition that user manually changes the default schema (e.g by callingalter user my_user with default_schema = my_schema
). This PR fixes that by utilizing the actual default schema (not alwaysdbo
).