I have the following code to import .csv file into my table in excel
It's being inserted into a table. dbo.ImportedPromoPricing.
Table and the .csv file have 3 fields price, code and selling price.
Once import is completed I want to use the data in my dbo.ImportedPromoPricing to update another table dbo.MasterPricing. Records need to be compared and updated or appended if needed. in case of update only price will be updated. this is the beginning of my code
/****** Object: StoredProcedure [dbo].[ImportPromoPricing] Script Date: 03/03/2014 14:04:01 ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
ALTER procedure [dbo].[ImportPromoPricing] as
truncate table dbo.ImportedPromoPricing
Bulk Insert dbo.ImportedPromoPricing
from 'D:\Reporting\DB\Sales\PromoPriceImport\PromoPrice Import.csv'
ROWTERMINATOR = '\n',
FIRSTROW = 2