Skip to content
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

[6.x] Fix for dropping columns when using MSSQL as database #39905

Merged
merged 1 commit into from Dec 6, 2021
Merged

[6.x] Fix for dropping columns when using MSSQL as database #39905

merged 1 commit into from Dec 6, 2021

Conversation

SyotaOkaniwa
Copy link
Contributor

When using MSSQL as the database for an application you are unable to drop columns.

    $table->dropColumn('name');

The error received is

SQLSTATE[42S02]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid object name 'SYS.COLUMNS'. (SQL: DECLARE @sql NVARCHAR(MAX) = '';SELECT @sql += 'ALTER TABLE...

This is due to the MSSQL system table must be select in lowercase.

However, if you select the option (_CI) that ignores the difference between uppercase and lowercase letters in the COLLATE option, no error occurs.
The error only occurs if you select the case-sensitive option (_CS).

Related Pull Request: #37308

@driesvints
Copy link
Member

@sokaniwa which SQL Server version are you using?

@SyotaOkaniwa
Copy link
Contributor Author

@driesvints
Microsoft SQL Server 2019 (RTM-CU13) (KB5005679) - 15.0.4178.1 (X64) Sep 23 2021 16:47:49 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Linux (Ubuntu 20.04.3 LTS)

@taylorotwell taylorotwell merged commit 2d72d1f into laravel:6.x Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants