Skip to content

Commit d96f74d

Browse files
committed
Update connector-azure-sql-database.md
1 parent 6027f0a commit d96f74d

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

articles/data-factory/connector-azure-sql-database.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: data-factory
88
ms.subservice: data-movement
99
ms.topic: conceptual
1010
ms.custom: synapse
11-
ms.date: 12/24/2021
11+
ms.date: 01/14/2022
1212
---
1313

1414
# Copy and transform data in Azure SQL Database by using Azure Data Factory or Azure Synapse Analytics
@@ -483,6 +483,12 @@ To copy data to Azure SQL Database, the following properties are supported in th
483483
| writeBatchTimeout | The wait time for the batch insert operation to finish before it times out.<br/> The allowed value is **timespan**. An example is "00:30:00" (30 minutes). | No |
484484
| disableMetricsCollection | The service collects metrics such as Azure SQL Database DTUs for copy performance optimization and recommendations, which introduces additional master DB access. If you are concerned with this behavior, specify `true` to turn it off. | No (default is `false`) |
485485
| maxConcurrentConnections |The upper limit of concurrent connections established to the data store during the activity run. Specify a value only when you want to limit concurrent connections.| No |
486+
| WriteBehavior | Specify the write behavior for copy activity to load data into Azure SQL Database. <br/> The allowed value is **Insert** and **Upsert**. By default, the service uses insert to load data. | No |
487+
| upsertSettings | Specify the group of the settings for write behavior. <br/> Apply when the WriteBehavior option is `Upert`. | No |
488+
| ***Under `upsertSettings`:*** | | |
489+
| useTempDB | Specify whether to use the a global temporary table or physical table as the interim table for upsert. <br>By default, the service uses global temporary table as the interim table. value is `true`. | No |
490+
| interimSchemaName | Specify the interim schema for creating interim table if physical table is used. Note: user need to have the permission for creating and deleting table. By default, interim table will share the same schema as sink table. <br/> Apply when the useTempDB option is `False`. | No |
491+
| keys | Specify the column names for unique row identification. Either a single key or a series of keys can be used. If not specified, the primary key is used. | No |
486492

487493
**Example 1: Append data**
488494

@@ -556,6 +562,45 @@ Learn more details from [Invoke a stored procedure from a SQL sink](#invoke-a-st
556562
}
557563
]
558564
```
565+
**Example 1: Upsert data**
566+
567+
```json
568+
"activities":[
569+
{
570+
"name": "CopyToAzureSQLDatabase",
571+
"type": "Copy",
572+
"inputs": [
573+
{
574+
"referenceName": "<input dataset name>",
575+
"type": "DatasetReference"
576+
}
577+
],
578+
"outputs": [
579+
{
580+
"referenceName": "<Azure SQL Database output dataset name>",
581+
"type": "DatasetReference"
582+
}
583+
],
584+
"typeProperties": {
585+
"source": {
586+
"type": "<source type>"
587+
},
588+
"sink": {
589+
"type": "AzureSqlSink",
590+
"tableOption": "autoCreate",
591+
"writeBatchSize": 100000,
592+
"writeBehavior": "upsert",
593+
"upsertSettings": {
594+
"useTempDB": true,
595+
"keys": [
596+
"<column name>"
597+
]
598+
},
599+
}
600+
}
601+
}
602+
]
603+
```
559604

560605
## Parallel copy from SQL database
561606

0 commit comments

Comments
 (0)