I am new to snaplogic. I have 2 tables(A, B) in SQL Server as below. I need to insert data from table A into table B based on the existence of numberID in B.
I would like to know how to perform case disjunction. I wanted to use a router or a conditional snap but I don't understand how to use them with the result of the SQL query. I need help please.
you can use merge function
MERGE INTO B AS Target
USING (select * from A)
AS Source
ON Target.id = Source.id
WHEN MATCHED THEN
UPDATE SET B.Name = Source.Name
WHEN NOT MATCHED BY TARGET THEN
INSERT (Name) VALUES (source.NewName)
https://learn.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql?view=sql-server-ver15