MERGEINTOProduction.ConstCustASTGT
USINGProduction.ConstCustUpdatesASSRC
ONTGT.CustomerId=SRC.CustomerID
USELab;
WHENMatchedTHEN
UPDATE
SETTGT.CustomerID=SRC.CustomerID,
TGT.CustomerCode=SRC.CustomerCode,
TGT.CustomerName=SRC.CustomerName,
TGT.CustomerAddress=SRC.CustomerAddress,
TGT.CustomerCity=SRC.CustomerCity,
TGT.CustomerState=SRC.CustomerState,
TGT.CustomerZipCode=SRC.CustomerZipCode,
TGT.CreditLimit=SRC.CreditLimit
WHENNOTMATCHEDTHEN
INSERT(CustomerCode,CustomerName,
CustomerAddress,CustomerCity,CustomerState,CustomerZipCode,CreditLimit)
Values(2,'Changed','Changed Name','Changed Address','Changed City','ID','83501',1000),
(4,'New','New Name','New Address','New City','CA','99999',9999);
Regards,
GGGGGNNNNN
GGGGGNNNNN