Skip to content

SqlPackage generates unsupported ALTER COLUMN when changing column types on Fabric Warehouse #784

@MarkusAngenendt

Description

@MarkusAngenendt
  • SqlPackage or DacFx Version: microsoft.sqlpackage 170.3.93
  • .NET Runtime: .NET 8.0 (v8.0.26)
  • Environment: Windows 11 / Source: SQL Database Project (VSCode) / Target: Microsoft Fabric Warehouse

Description
When changing a column's data type in a SQL Database Project targeting a Fabric Warehouse, SqlPackage generates ALTER COLUMN — which is not supported in Fabric Warehouse and causes the deployment to fail.

Steps to Reproduce:

  1. Create a Data Warehouse and a table in Microsoft Fabric
  2. Create a SQL Database Project as described here:
    https://learn.microsoft.com/en-us/fabric/data-warehouse/develop-warehouse-project
  3. Change a column's data type (e.g. from VARCHAR(500) to VARCHAR(1000))
  4. Deploy or generate a script via SqlPackage

Actual Behavior

The generated deployment script contains:

PRINT N'Altering Table [setting].[ReportLog]...';
GO
ALTER TABLE [setting].[ReportLog] ALTER COLUMN [rl_error] VARCHAR (1000) NULL;
GO

This fails on Fabric Warehouse with:

Msg 24585, Level 16, State 2, Line 43
The specified ALTER TABLE statement is not supported in this edition of SQL Server.

Expected Behavior

When targeting a Fabric Warehouse, SqlPackage should use a table recreate pattern instead of ALTER COLUMN:

  1. Add new column with target data type
  2. Copy data from old column
  3. Drop old column
  4. Rename new column

Suggestion

SqlPackage can detect a Fabric Warehouse target either via the connection at runtime or via the presence of the Microsoft.SqlServer.Dacpacs.FabricDw package reference in the project:

<ItemGroup>
  <PackageReference Include="Microsoft.SqlServer.Dacpacs.FabricDw" Version="170.0.2" />
</ItemGroup>

When a Fabric Warehouse target is detected, ALTER COLUMN should never be generated since it is architecturally not supported on this platform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions