Forum Discussion
ALTER TABLE DW
- Hi smpa01
I understand the frustration. This is a known limitation in Fabric Data Warehouse as of today.
Root Cause:
Fabric DW is built on Synapse Dedicated SQL Pool architecture. In this engine, `ALTER TABLE ALTER COLUMN` is not supported. That’s why you are getting:
`Msg 2401, Level 16, State 2, Line 21 - The specified ALTER TABLE statement is not supported`
What IS supported vs NOT supported:
| Operation | Status in Fabric DW |
| --- | --- |
| `ALTER TABLE ADD COLUMN` | Supported |
| `ALTER TABLE DROP COLUMN` | Supported |
| `ALTER TABLE ALTER COLUMN` | Not Supported |
| `ALTER TABLE RENAME` | Not Supported |
**Recommended Workaround - CTAS Pattern:**
Microsoft recommends using `CREATE TABLE AS SELECT` to change data types. Here is the full flow for your case:
```sql
Step 1: Create new table with updated schema
CREATE TABLE [dbo].[test_log_new]
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
AS
SELECT
CAST([row_sum] AS DECIMAL(38,6)) AS [row_sum], -- changed data type
[col2],
[col3],
CAST(NULL AS VARCHAR(50)) AS [ingestion_engine] -- new column added
FROM [dbo].[test_log];
Step 2: Validate data in new table
SELECT TOP 100 * FROM [dbo].[test_log_new];
Step 3: Swap tables
DROP TABLE [dbo].[test_log];
EXEC sp_rename 'dbo.test_log_new', 'test_log';