Skip to content

Commit 8dc98e8

Browse files
authored
Update data-flow-alter-row.md
1 parent 4ccd01e commit 8dc98e8

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

articles/data-factory/data-flow-alter-row.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.reviewer: daperlov
77
ms.service: data-factory
88
ms.topic: conceptual
99
ms.custom: seo-lt-2019
10-
ms.date: 04/20/2020
10+
ms.date: 05/06/2020
1111
---
1212

1313
# Alter row transformation in mapping data flow
@@ -20,6 +20,8 @@ Use the Alter Row transformation to set insert, delete, update, and upsert polic
2020

2121
Alter Row transformations will only operate on database or CosmosDB sinks in your data flow. The actions that you assign to rows (insert, update, delete, upsert) won't occur during debug sessions. Run an Execute Data Flow activity in a pipeline to enact the alter row policies on your database tables.
2222

23+
> [!VIDEO https://www.microsoft.com/en-us/videoplayer/embed/RE4vJYc]
24+
2325
## Specify a default row policy
2426

2527
Create an Alter Row transformation and specify a row policy with a condition of `true()`. Each row that doesn't match any of the previously defined expressions will be marked for the specified row policy. By default, each row that doesn't match any conditional expression will be marked for `Insert`.
@@ -50,6 +52,18 @@ The default behavior is to only allow inserts. To allow updates, upserts, or del
5052
5153
The sink transformation requires either a single key or a series of keys for unique row identification in your target database. For SQL sinks, set the keys in the sink settings tab. For CosmosDB, set the partition key in the settings and also set the CosmosDB system field "id" in your sink mapping. For CosmosDB, it is mandatory to include the system column "id" for updates, upserts, and deletes.
5254

55+
## Merges and upserts with Azure SQL Database and Synapse
56+
57+
ADF Data Flows supports merges against Azure SQL Database and Synapse database pool (data warehouse) with the upsert option.
58+
59+
However, you may run into scenarios where your target database schema utilized the identity property of key columns. ADF requires you to identify the keys that you will use to match the row values for updates and upserts. But if the target column has the identity property set and you are using the upsert policy, the target database will not allow you to write to the column.
60+
61+
You have two options:
62+
63+
1. Use the Sink transformation pre-processing SQL option: ```SET IDENTITY_INSERT tbl_content ON```. Then, turn it off with the post-processing SQL property: ```SET IDENTITY_INSERT tbl_content OFF```.
64+
65+
2. Rather than use upsert, switch your logic to separate the update conditions from the insert conditions using a Conditional Split transformation. This way, you can set the mapping on the update path to ignore the key column mapping.
66+
5367
## Data flow script
5468

5569
### Syntax

0 commit comments

Comments
 (0)