You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/data-factory/data-flow-alter-row.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.reviewer: daperlov
7
7
ms.service: data-factory
8
8
ms.topic: conceptual
9
9
ms.custom: seo-lt-2019
10
-
ms.date: 04/20/2020
10
+
ms.date: 05/06/2020
11
11
---
12
12
13
13
# Alter row transformation in mapping data flow
@@ -20,6 +20,8 @@ Use the Alter Row transformation to set insert, delete, update, and upsert polic
20
20
21
21
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.
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
50
52
51
53
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.
52
54
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.
0 commit comments