Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2014
    Posts
    5

    Unanswered: Need help with my store procedure

    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


    USE [Reporting]
    GO
    /****** Object: StoredProcedure [dbo].[ImportPromoPricing] Script Date: 03/03/2014 14:04:01 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER procedure [dbo].[ImportPromoPricing] as
    begin
    truncate table dbo.ImportedPromoPricing

    Bulk Insert dbo.ImportedPromoPricing
    from 'D:\Reporting\DB\Sales\PromoPriceImport\PromoPrice Import.csv'
    with
    (FIELDTERMINATOR =',',
    ROWTERMINATOR = '\n',
    FIRSTROW = 2
    )

  2. #2
    Join Date
    Jan 2009
    Location
    United Kingdom
    Posts
    77
    is your plan to complete in one stored procedure or break down over multiple procedures.
    You might want to think about some sort of error logging

  3. #3
    Join Date
    Jan 2014
    Posts
    5
    it could be more than one procedure. PriceCode and StockCode are the primary Keys

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •