Last post Apr 26, 2017 08:54 AM by wmec
Apr 25, 2017 12:18 PM|hajiahmadkhan|LINK
I have two tables with same schema CommodityItems and CommodityItems_Temporary.
There are about 140 Millions records in CommodityItems table and I have an application which imports xml file into CommodityItems_Temporary table there may 1000 to 100000 records in the xml file.
Now what will be the best and efficient way to Insert/update record from CommodityItems_Temporary table to CommodityItems table.
Apr 25, 2017 12:27 PM|kaushalparik27|LINK
You may would like to use Merge Statement in SQL Server:
Inserting, Updating, and Deleting Data by Using MERGE
MERGE (Transact-SQL) | Microsoft Docs
Apr 26, 2017 08:54 AM|wmec|LINK
You can use Union/Union all to merge the two tables, while both tables should be have same table structure!