- 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:
- Create a Data Warehouse and a table in Microsoft Fabric
- Create a SQL Database Project as described here:
https://learn.microsoft.com/en-us/fabric/data-warehouse/develop-warehouse-project
- Change a column's data type (e.g. from
VARCHAR(500) to VARCHAR(1000))
- 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:
- Add new column with target data type
- Copy data from old column
- Drop old column
- 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.
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:
https://learn.microsoft.com/en-us/fabric/data-warehouse/develop-warehouse-project
VARCHAR(500)toVARCHAR(1000))Actual Behavior
The generated deployment script contains:
This fails on Fabric Warehouse with:
Expected Behavior
When targeting a Fabric Warehouse, SqlPackage should use a table recreate pattern instead of
ALTER COLUMN:Suggestion
SqlPackage can detect a Fabric Warehouse target either via the connection at runtime or via the presence of the
Microsoft.SqlServer.Dacpacs.FabricDwpackage reference in the project:When a Fabric Warehouse target is detected,
ALTER COLUMNshould never be generated since it is architecturally not supported on this platform.