Hi,@Samuel Isai Paredes Morales
Welcome to Microsoft T-SQL Q&A Forum!
You can achieve it using merge into statement.
MERGE INTO [TableA] AS [target]
using (SELECT distinct [Id] , [Selection1], [Selection2], [Selection3]
FROM [TableB]
) AS [source]
ON [target].[ID] = [source].ID
WHEN NOT matched THEN
INSERT ([Id], [Selection1], [Selection2], [Selection3])
VALUES ([Id], [Selection1], [Selection2], [Selection3]);
Refer to the link on this issue, if you want to know the use of merge into, please click here.
Best regards,
Bert Zhou
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.