Skip to content

Conversation

@SyotaOkaniwaITR
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?

@SyotaOkaniwaITR
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.

3 participants