Search
 
SCRIPT & CODE EXAMPLE
 

SQL

tsql merge example

MERGE esqlProductTarget T
USING esqlProductSource S
ON (S.ProductID = T.ProductID)
WHEN MATCHED 
     THEN UPDATE
     SET    T.Name = S.Name,
            T.ProductNumber = S.ProductNumber,
            T.Color = S.Color
WHEN NOT MATCHED BY TARGET
THEN INSERT (ProductID, Name, ProductNumber, Color)
     VALUES (S.ProductID, S.Name, S.ProductNumber, S.Color)
WHEN NOT MATCHED BY SOURCE
THEN DELETE;
Comment

PREVIOUS NEXT
Code Example
Sql :: drop table if exists in postgres 
Sql :: how to see which columns are indexxed mysql 
Sql :: sql server connection string in .net core with password 
Sql :: alter foreign key 
Sql :: oracle search stored procedures for text 
Sql :: rename table sql 
Sql :: ms sql rename database 
Sql :: show all sequence in postgresql 
Sql :: change column name mysql command line 
Sql :: mysql allow remote connections 
Sql :: oracle show running job 
Sql :: set database timezone mysql 
Sql :: rename table postgres 
Sql :: best configuration for display table in sqlplus 
Sql :: import database in mysql command line xampp 
Sql :: alter table add foreign key mysql 
Sql :: sqlserver add column to table 
Sql :: sql eliminare un record 
Sql :: mysql get yesterday 
Sql :: ORACLE RIGHT TWO DIGITS 
Sql :: how to convert number to hours and minutes in oracle sql 
Sql :: mysql strict_trans_tables 
Sql :: sql headers delphi 
Sql :: mysql random number between 1 and 100 
Sql :: foreign key oracle 
Sql :: Aqua Data studio postgresql ssl 
Sql :: delete all rows from table mysql 
Sql :: show table columns 
Sql :: mysql case when null 
Sql :: mssql int max value 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =