Bulk updating gem source index

Requirement 1: There is a table which contains Country, State, City, Remarks columns. In our example, let us take the combination of Country, State, City columns are considered as identity column (primary column) for a single record. City) WHEN NOT MATCHED BY TARGET THEN INSERT (Country, State, City, Remarks) VALUES(Source Table.

Fax; SELECT * FROM Customers; END [Update 10-Sep-2012] As Charles Rice comment, I am updating this post with an example for importing data into a table that has Auto increment column. The comparision must be decided by other columns (may be more the one) to insert or update the records from csv file.

Contact Title, Target Table.[Address] = Source Table.[Address], Target Table.

bulk updating gem source index-5bulk updating gem source index-76bulk updating gem source index-7

The XML file looks as below: CREATE PROCEDURE SP_Import Customer Data_XML AS BEGIN -- Creating a Temproary Table for importing the data from csv file. F., NULL,5023, Mexico,(5) 555-3932, NULL AROUT, Around the Horn, Thomas Hardy, Sales Representative,120 Hanover Sq., London, NULL, WA1 1DP, UK,(171) 555-7788,(171) 555-6750 BERGS, Berglunds snabbk”p, Christina Berglund, Order Administrator, Berguvsv„gen 8, Lule†, NULL, S-958 22, Sweden,0921-12 34 65,0921-12 34 67 BLAUS, Blauer See Delikatessen, Hanna Moos, Sales Representative, Forsterstr. 57, Mannheim, NULL,68306, Germany,0621-08460,0621-08924 BLONP, Blondesddsl pŠre et fils, Fr‚d‚rique Citeaux, Marketing Manager,"24, place Kl‚ber", Strasbourg, NULL,67000, France,.31,.32 BOTTM, Bottom-Dollar Markets, Elizabeth Lincoln, Accounting Manager,23 Tsawassen Blvd., Tsawassen, BC, T2F 8M4, Canada,(604) 555-4729,(604) 555-3745 BSBEV, B's Beverages, Victoria Ashworth, Sales Representative, Fauntleroy Circus, London, NULL, EC2 5NT, UK,(171) 555-1212, NULL CACTU, Cactus Comidas para llevar, Patricio Simpson, Sales Agent, Cerrito 333, Buenos Aires, NULL,1010, Argentina,(1) 135-5555,(1) 135-4892 CENTC, Centro comercial Moctezuma, Francisco Chang, Marketing Manager, Sierras de Granada 9993, M‚xico D. In this post I am going do bulk import using BULK INSERT and MERGE statements. We use both BULK INSERT and MERGE statements as this implementation not only used for inserting the records, also for updating records if already exist.

Leave a Reply