SqlPackage generates unsupported ALTER COLUMN when changing column types on Fabric Warehouse
- Dominant language
- C#
- Stars
- 460
- Forks
- 29
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 7
Description
- 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:
```sql
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:
```xml
```
When a Fabric Warehouse target is detected, `ALTER COLUMN` should never be generated since it is architecturally not supported on this platform.
Contributor guide
Research direction
Start by reproducing the issue with the documented SQL Database Project, Fabric Warehouse target, and SqlPackage 170.3.93 workflow, then inspect the deployment script generation path for Fabric Warehouse column type changes. Done means the generated script uses the requested recreate pattern and no longer emits ALTER COLUMN for this target.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100