https://learn.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql?view=sql-server-ver15
I have two table
[dbo].[table_product] and [dbo].[ex_table_product], and would like to merge [dbo].[ex_table_product] data into [dbo].[table_product] . Using the following code
DECLARE @SummaryOfChanges TABLE (Change VARCHAR(20));
MERGE INTO [dbo].[table_product] AS Target
USING (select ProductKey,ProductLabel,ProductName from [dbo].[ex_table_product])
AS Source (ProductKey,ProductLabel,ProductName)
ON (Target.ProductKey = Source.ProductKey)
WHEN MATCHED THEN
UPDATE SET ProductLabel = Source.ProductLabel
WHEN NOT MATCHED BY TARGET THEN
INSERT (ProductKey,ProductLabel,ProductName) VALUES (ProductKey,ProductLabel,ProductName)
OUTPUT $action INTO @SummaryOfChanges;
just think that if MERGE INTO already supported in Azure Synapse , as well as Azure synapse studio . cause there are so many syntax warning right there .