Skip to content

Commit ab95af6

Browse files
authored
Update data-flow-alter-row.md
1 parent b1c76ec commit ab95af6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ The sink transformation requires either a single key or a series of keys for uni
5656

5757
ADF Data Flows supports merges against Azure SQL Database and Synapse database pool (data warehouse) with the upsert option.
5858

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.
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. You may also run into errors when you try to upsert against a distributed table's distribution column.
6060

61-
You have two options:
61+
Here are ways to fix that:
6262

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```.
63+
1. Go to the Sink transformation Settings and set "Skip writing key columns". This will tell ADF to not write the column that you have selected as the key value for your mapping.
6464

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.
65+
2. If that key column is not the column that is causing the issue for identity columns, then you can 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```.
66+
67+
3. For both the identity case and the distribution column case, you can switch your logic from Upsert to using a separate update condition and a separate insert condition using a Conditional Split transformation. This way, you can set the mapping on the update path to ignore the key column mapping.
6668

6769
## Data flow script
6870

0 commit comments

Comments
 (0)