Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
sarunachalam
Regular Visitor

upsert option missing in copy activity of microsoft fabric data pipeline

Hi 

 

I don't see an option to upsert (insert new rows and update existing rows based on PK) in copy activity or in data flow gen2. Is there an alternative how I can acheive this? I am using Azure SQL Warehouse in Fabric as target.

 

Regards

Subbu

1 ACCEPTED SOLUTION
sarunachalam
Regular Visitor

Hi Thanks for the response.

 

I used a work around, I load the data to a stage table and then created a procedure to left join the stage table & actual table to compare & insert missing records and update the existing records with 2 seperate SQL statements (first for update and then for insert). 

View solution in original post

4 REPLIES 4
sarunachalam
Regular Visitor

Hi Thanks for the response.

 

I used a work around, I load the data to a stage table and then created a procedure to left join the stage table & actual table to compare & insert missing records and update the existing records with 2 seperate SQL statements (first for update and then for insert). 

v-nuoc-msft
Community Support
Community Support

Hi @sarunachalam 

 

Can you tell me if your problem is solved? If yes, please accept it as solution.

 

Regards,

Nono Chen

sarunachalam
Regular Visitor

Thanks for your quick response. I am looking for upsert option in data pipelines or data flow gen2. I understand MERGE command is not available in Azure SQL Warehouse as of now. But in one of the thread in the link https://community.fabric.microsoft.com/t5/Data-Pipelines/Fabric-Data-Factory-Pipeline-Incremental-lo... I understand this is now enabled in a private view This is the part of the comment I read. Hence wanted to check if there is a way to get the upsert (Its in private preview, please ping me with your workspace id, and we can enable it for you along with instructions.)

NandanHegde
Super User
Super User

Based on my knowlegde, Upsert/Merge is not yet directly supported for fabric warehouse.

So you would have to copy the data into a staging table and then leverage the below logic to upsert into destination table

https://community.fabric.microsoft.com/t5/Data-Pipelines/Datawarehouse-MERGE-command-not-working-in-...

 




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.