Skip to content

Commit a20acd0

Browse files
Merge pull request #13750 from WilliamDAssafMSFT/20260403-dw-alter-table-transaction
20260403 dw alter table transaction
2 parents f0946cf + a25fa95 commit a20acd0

4 files changed

Lines changed: 42 additions & 17 deletions

File tree

docs/data-warehouse/tables.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Tables in Fabric Data Warehouse
33
description: Learn how to design and use tables in Microsoft Fabric Data Warehouse, including temporary tables.
44
ms.reviewer: xiaoyul, randolphwest
5-
ms.date: 09/24/2025
5+
ms.date: 04/03/2026
66
ms.topic: how-to
77
ms.search.form: Warehouse design and development # This article's title should not change. If so, contact engineering.
88
---
@@ -107,7 +107,7 @@ Session-scoped temporary (`#temp`) tables can be created in Fabric Data Warehous
107107

108108
These tables exist only within the session in which they are created and last for the duration of that session. They are not visible to other users or sessions and are automatically dropped from the system once the session ends or the #temp table is dropped. These tables are accessible to all users without requiring specific item-level permission.
109109

110-
Two types of #temp tables can be created based on specific use cases, non-distributed and distributed.
110+
Two types of #temp tables can be created based on specific use cases: non-distributed and distributed.
111111

112112
- A non-distributed #temp table (mdf-backed) is the default type. The syntax for creating and using non-distributed #temp tables in Fabric Data Warehouse is similar to user tables, but you need to prefix the temp table name with `#`.
113113

@@ -129,9 +129,13 @@ Two types of #temp tables can be created based on specific use cases, non-distri
129129

130130
In the previous script, `data_type1` and `data_type2` are placeholders for supported [Data types in Fabric Data Warehouse](data-types.md).
131131

132-
Distributed #temp tables are recommended, as they align with normal user tables; they have unlimited storage, data type support, and T-SQL operations. The syntax for data manipulation and definition is identical to user tables in Fabric Data Warehouse, with prefix `#` added to the table name.
132+
Distributed #temp tables are recommended, as they align with normal user tables; they have unlimited storage, data type support, and T-SQL operations.
133133

134-
In Fabric Data Warehouse, temp tables are not affected by [time travel](time-travel.md) query hints and always return the latest data in the table.
134+
Other notes about temp tables in Fabric Data Warehouse:
135+
136+
- The syntax for data manipulation and definition is identical to user tables in Fabric Data Warehouse, with prefix `#` added to the table name.
137+
- Temp tables are not affected by [time travel](time-travel.md) query hints and always return the latest data in the table.
138+
- You can alter distributed temp tables with `ALTER TABLE`, but not MDF-backed temp tables.
135139

136140
## Align source data with the data warehouse
137141

docs/data-warehouse/transactions.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Transactions in Fabric Data Warehouse
33
description: Learn how to use transactions and how to insert and modify data in Warehouse tables in Microsoft Fabric.
44
ms.reviewer: twcyril
5-
ms.date: 10/17/2025
5+
ms.date: 4/7/2026
66
ms.topic: how-to
77
ms.search.form: Warehouse design and development
88
---
@@ -16,7 +16,7 @@ Fabric Data Warehouse supports ACID-compliant transactions. Each transaction is
1616

1717
## Explicit transactions
1818

19-
You can modify data that is stored in tables in a [!INCLUDE [fabric-dw](includes/fabric-dw.md)] using explicit transactions to group changes together.
19+
You can modify data that is stored in tables in a [!INCLUDE [fabric-dw](includes/fabric-dw.md)] using explicit transactions to group changes together.
2020

2121
For example, you could commit inserts to multiples tables, or, none of the tables if an error arises. If you're changing details about a purchase order that affects three tables, you can group those changes into a single transaction. That means when those tables are queried, they either all have the changes or none of them do. Transactions are a common practice for when you need to ensure your data is consistent across multiple tables.
2222

@@ -25,6 +25,26 @@ You can use standard T-SQL (`BEGIN TRAN`, `COMMIT TRAN`, and `ROLLBACK TRAN`) sy
2525
- [COMMIT TRANSACTION](/sql/t-sql/language-elements/commit-transaction-transact-sql?view=fabric&preserve-view=true)
2626
- [ROLLBACK TRANSACTION](/sql/t-sql/language-elements/rollback-transaction-transact-sql?view=fabric&preserve-view=true)
2727

28+
For example, Fabric Data Warehouse will treat these schema changes as a single atomic unit:
29+
30+
```sql
31+
-- Sample Syntax---
32+
BEGIN TRAN;
33+
ALTER TABLE <table_name> ADD <column_name> <type>;
34+
ALTER TABLE <table_name> DROP COLUMN <column_name>;
35+
COMMIT;
36+
```
37+
38+
If any statement in the transaction fails, all schema changes are automatically rolled back.
39+
40+
Fabric Data Warehouse supports executing the following inside an explicit transaction:
41+
42+
- `ALTER TABLE` add nullable columns
43+
- `ALTER TABLE` drop columns
44+
- `ALTER TABLE` add or drop `PRIMARY KEY`, `UNIQUE`, and `FOREIGN KEY` constraints with the `NOT ENFORCED` keyword
45+
- Multiple `ALTER TABLE` statements
46+
- `ALTER TABLE` on distributed temporary tables
47+
2848
### Cross-database query transaction support
2949

3050
[!INCLUDE [fabric-dw](includes/fabric-dw.md)] in [!INCLUDE [product-name](../includes/product-name.md)] supports transactions that span across warehouses that are within the same workspace, including reading from the [SQL analytics endpoint of the Lakehouse](data-warehousing.md#sql-analytics-endpoint-of-the-lakehouse). For an example, see [Write a cross-database SQL Query](query-warehouse.md#write-a-cross-database-query).
@@ -129,7 +149,6 @@ INSERT statements always create new parquet files, which means fewer conflicts w
129149
## Limitations
130150

131151
- Distributed transactions are not supported, for example, `BEGIN DISTRIBUTED TRANSACTION`.
132-
- `ALTER TABLE` is not supported within an explicit transaction.
133152
- Save points are not supported.
134153
- Named transactions are not supported.
135154
- Marked transactions are not supported.

docs/data-warehouse/tsql-surface-area.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: T-SQL Surface Area in Fabric Data Warehouse
33
description: T-SQL surface area of the SQL analytics endpoint and warehouse in Microsoft Fabric.
44
ms.reviewer: cynotebo, jovanpop, twinklecyril, emtehran, prlangad
5-
ms.date: 02/04/2026
5+
ms.date: 04/07/2026
66
ms.topic: concept-article
77
ms.search.form: T-SQL Surface area # This article's title should not change. If so, contact engineering.
88
---
@@ -21,28 +21,28 @@ For SQL database in Fabric, see [Limitations in SQL database (preview)](../datab
2121

2222
Fabric Data Warehouse supports T-SQL tables, views, stored procedures, functions, permissions, and security roles.
2323

24-
- For more about CREATE/DROP TABLE support in [!INCLUDE [fabric-dw](includes/fabric-dw.md)], see [Tables](tables.md).
24+
- For more about `CREATE`/`DROP` `TABLE` support in [!INCLUDE [fabric-dw](includes/fabric-dw.md)], see [Tables](tables.md).
2525
- For more about supported data types in [!INCLUDE [fabric-dw](includes/fabric-dw.md)], see [Data types](data-types.md).
2626
- You can also create T-SQL views, functions, and procedures on top of the tables that reference your Delta Lake data in the [!INCLUDE [fabric-se](includes/fabric-se.md)] of the Lakehouse.
2727
- Creating, altering, and dropping tables, and insert, update, and delete are only supported in [!INCLUDE [fabric-dw](includes/fabric-dw.md)] in [!INCLUDE [product-name](../includes/product-name.md)], not in the [!INCLUDE [fabric-se](includes/fabric-se.md)] of the Lakehouse.
28-
- Fabric Warehouse and SQL analytics endpoint both support *standard*, *sequential*, and *nested* CTEs. While CTEs are generally available in Microsoft Fabric, nested CTEs are currently a preview feature. For more information, see [Nested Common Table Expression (CTE) in Fabric data warehousing (Transact-SQL)](/sql/t-sql/queries/nested-common-table-expression?view=fabric&preserve-view=true).
28+
- Fabric Warehouse and SQL analytics endpoint both support *standard*, *sequential*, and *nested* common table expressions (CTEs). While CTEs are generally available in Microsoft Fabric, nested CTEs are currently a preview feature. For more information, see [Nested Common Table Expression (CTE) in Fabric data warehousing (Transact-SQL)](/sql/t-sql/queries/nested-common-table-expression?view=fabric&preserve-view=true).
2929
- [TRUNCATE TABLE](/sql/t-sql/statements/truncate-table-transact-sql?view=fabric&preserve-view=true) is supported in [!INCLUDE [fabric-dw](includes/fabric-dw.md)].
3030
- To change the name of the column in a user table in [!INCLUDE [fabric-dw](includes/fabric-dw.md)], use the `sp_rename` stored procedure.
3131
- A subset of query and join hints are supported in [!INCLUDE [fabric-dw](includes/fabric-dw.md)]. For more information, see [Hints (Transact-SQL)](/sql/t-sql/queries/hints-transact-sql-query?view=fabric&preserve-view=true).
3232
- Session-scoped distributed #temp tables are supported in [!INCLUDE [fabric-dw](includes/fabric-dw.md)] in [!INCLUDE [product-name](../includes/product-name.md)].
33+
- Currently, only the following subset of `ALTER TABLE` operations in [!INCLUDE [fabric-dw](includes/fabric-dw.md)] in [!INCLUDE [product-name](../includes/product-name.md)] are supported:
34+
- You can `ADD` nullable columns of supported column data types.
35+
- `DROP COLUMN` is supported.
36+
- `ADD` or `DROP` `PRIMARY KEY`, `UNIQUE`, and `FOREIGN_KEY` column constraints are supported, but only if the `NOT ENFORCED` option has been specified. All other `ALTER TABLE` operations are blocked. There are limitations with adding table constraints or columns when using [Source Control with Warehouse](source-control.md#limitations-in-source-control).
37+
- `ALTER` distributed temporary tables are supported.
38+
- Supported `ALTER TABLE` statements can be executed inside an explicit user-defined transaction in [!INCLUDE [fabric-dw](includes/fabric-dw.md)] in [!INCLUDE [product-name](../includes/product-name.md)].
3339
- `MERGE` syntax is supported and is a generally available feature. For more information, see [MERGE T-SQL syntax](/sql/t-sql/statements/merge-transact-sql?view=fabric&preserve-view=true).
3440
- [AI functions (preview)](ai-functions.md) enable advanced text processing without leaving your warehouse.
3541

3642
### Limitations
3743

3844
At this time, the following list of commands is NOT currently supported. Don't try to use these commands. Even though they might appear to succeed, they could cause issues to your warehouse.
3945

40-
- `ALTER TABLE ADD`/`ALTER`
41-
- Currently, only the following subset of `ALTER TABLE` operations in [!INCLUDE [fabric-dw](includes/fabric-dw.md)] in [!INCLUDE [product-name](../includes/product-name.md)] are supported:
42-
- ADD nullable columns of supported column data types.
43-
- `DROP COLUMN`
44-
- ADD or DROP PRIMARY KEY, UNIQUE, and FOREIGN_KEY column constraints, but only if the NOT ENFORCED option has been specified. All other ALTER TABLE operations are blocked.
45-
- There are limitations with adding table constraints or columns when using [Source Control with Warehouse](source-control.md#limitations-in-source-control).
4646
- `BULK LOAD`
4747
- `CREATE USER`
4848
- `FOR JSON` must be the last operator in the query, and so is not allowed inside subqueries

docs/fundamentals/whats-new.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "What's New?"
33
description: Learn about the new features and documentation improvements for Microsoft Fabric.
44
author: WilliamDAssafMSFT
55
ms.author: wiassaf
6-
ms.date: 04/07/2026
6+
ms.date: 04/12/2026
77
ms.update-cycle: 30-days
88
ms.topic: whats-new
99
ms.collection:
@@ -157,6 +157,7 @@ The following table lists the features of Microsoft Fabric that recently transit
157157

158158
|**Month** | **Feature** | **Learn more** |
159159
|:-- |:-- | :-- |
160+
|April 2026|**Warehouse ALTER TABLE support in an explicit transaction (Generally available)**|Supported `ALTER TABLE` Transact-SQL operations can now execute inside an explicit user-defined transaction in Fabric Data Warehouse. For more information, see [Transactions in Fabric Data Warehouse](../data-warehouse/transactions.md#explicit-transactions).|
160161
|April 2026|**Shortcut transformations (Generally Available)**|Shortcut transformations automatically turn structured files into Delta tables as you bring data into or move it within OneLake, keeping data always in sync without the need for pipelines. For more information, see [Shortcuts file transformations](../onelake/shortcuts/transformations.md).|
161162
|March 2026|**Workspace IP firewall rules (Generally Available)** | Workspace IP firewall rules let workspace admins define an allow list of public IP addresses or IP ranges that can access a Fabric workspace, helping limit inbound access to approved network locations. For more information, see [Protect workspaces by using IP firewall rules](../security/security-workspace-level-firewall-overview.md).|
162163
|March 2026| `ANY_VALUE` aggregate function| Fabric Data Warehouse introduces the `ANY_VALUE` aggregate function, which lets you return a representative value from each group without requiring it to be part of the GROUP BY clause. This is especially useful when grouped rows share the same logical value or when an exact choice isn't important, helping simplify queries, reduce boilerplate aggregation logic, and improve query readability. For more information, see [ANY_VALUE (Transact-SQL) function](/sql/t-sql/functions/any-value-transact-sql?view=fabric&preserve-view=true).|
@@ -419,6 +420,7 @@ This section summarizes recent improvements and features for [Fabric Data Wareho
419420

420421
|**Month** | **Feature** | **Learn more** |
421422
|:-- |:-- | :-- |
423+
|April 2026|**ALTER TABLE support in an explicit transaction (Generally available)**|Supported `ALTER TABLE` Transact-SQL operations can now execute inside an explicit user-defined transaction in Fabric Data Warehouse. For more information, see [Transactions in Fabric Data Warehouse](../data-warehouse/transactions.md#explicit-transactions).|
422424
|March 2026|**Built-in AI functions (preview)**| Fabric Data Warehouse now brings AI directly into T‑SQL, enabling you to categorize and classify text, analyze sentiment, extract structured information, translate text across languages, and even correct grammar—all using built‑in AI functions. To get started, see [Use AI functions in Fabric Data Warehouse (preview)](../data-warehouse/ai-functions.md).|
423425
|March 2026|**ANY_VALUE**| Fabric Data Warehouse introduces the ANY_VALUE aggregate function, which lets you return a representative value from each group without requiring it to be part of the GROUP BY clause. This is especially useful when grouped rows share the same logical value or when an exact choice isn't important, helping simplify queries, reduce boilerplate aggregation logic, and improve query readability. For more information, see [ANY_VALUE (Transact-SQL) function](/sql/t-sql/functions/any-value-transact-sql?view=fabric&preserve-view=true).|
424426
|March 2026|**Outbound Access Protection (OAP) for Warehouse (Generally Available)**|[Outbound Access Protection (OAP) support for Warehouse (Generally Available)](https://blog.fabric.microsoft.com/blog/fabric-march-2026-feature-summary/#post-34196-_Toc224559641) provides stronger data exfiltration protection for enterprise environments, with connector rules that allow you to control external sources including specific Azure Data Lake Storage Gen2 accounts, other Fabric workspaces, and approved external connectors. For more information, see [Workspace outbound access protection for data warehouse workloads](../security/workspace-outbound-access-protection-data-warehouse.md).|

0 commit comments

Comments
 (0)