Forum Discussion
Support for MERGE statement
Hi,
reading the documentation I've noticed the absence of the MERGE statement.
Does Fabric support this more important statement? Why not?
A such statement is very very important to work with a data warehouse!
In SQL Server I've used this statement, in Azure Synapse Analytics I've used this statement,
but I cannot find it in Fabric.
I hope that this feature could be released as soon as possible.
Many many thanks
pmscorca ,
I agree, it is a handy syntax.
It seems, MS is already working on it though 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
5 Replies
- tackytechtomMost Valuable Professional
Hi pmscorca ,
You are right, it seems ot be a current limitation:
T-SQL surface area - Microsoft Fabric | Microsoft Learn
However, you might be able to use another syntax than the merge statement, e.g. the code below:
MERGE INTO target_table AS target USING source_table AS source ON target.id = source.id WHEN MATCHED THEN UPDATE SET target.col1 = source.col1, target.col2 = source.col2 WHEN NOT MATCHED THEN INSERT (id, col1, col2) VALUES (source.id, source.col1, source.col2);translates to:
UPDATE target_table SET target_table.col1 = source_table.col1, target_table.col2 = source_table.col2 FROM source_table WHERE target_table.id = source_table.id; INSERT INTO target_table (id, col1, col2) SELECT source_table.id, source_table.col1, source_table.col2 FROM source_table LEFT JOIN target_table ON source_table.id = target_table.id WHERE target_table.id IS NULL;Let me know, if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/- pmscorcaKudo Kingpin
Hi, thanks for your reply, but I know that it occurs to use an update and an insert statements when merge statement isn't available.
The focus of the post is about the merge statement ... having a such feature is very very important.
Thanks
- tackytechtomMost Valuable Professional
pmscorca ,
I agree, it is a handy syntax.
It seems, MS is already working on it though 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/- toribiolmSXPFrequent Visitor
Merge statment has now been made available in Fabric in September 2025
Fabric September 2025 Feature Summary | Microsoft Fabric Blog | Microsoft Fabric
- pmscorcaKudo Kingpin