Procedure to Update Item Master in SQL Server

Procedure to Update Item Master in SQL Server

1.Create New Item Temp Table  [ItemMasterForNewItemUpdates] in SQL Server

2.Import provided Items into above table using import wizard in SQL Server from excel or other sources

3.Comapre both existing and new items by below query
select * FROM         ItemMaster as a right JOIN
[ItemMasterForNewItemUpdates] as b ON a.ItemNumber = b.ItemNumber

4.Remove Item from temp table
--Delete FROM b
--FROM         ItemMaster as a INNER JOIN
--                      [ItemMasterForNewItemUpdates] as b ON a.ItemNumber = b.ItemNumber


5.Insert newly find Items to Actual ItemMaster Table by below command
INSERT INTO ItemMaster
                      (ItemNumber, ItemDescription, ItemTypeCode, StockUOM, Status, AddedBy, AddedOn)
SELECT     ItemNumber, ItemDescription, ItemTypeCode, StockUOM, Status, AddedBy, AddedOn
FROM         ItemMasterForNewItemUpdates

Comments