SSIS Execute a Stored Procedure with the parameters from .CSV file SQL Server 2005

后端 未结 4 616
陌清茗
陌清茗 2021-01-25 18:08

I\'m learning SSIS and this seems like an easy task but I\'m stuck.

I have a CSV file Orders.csv with this data:

ProductId,Quantity,CustomerId
1,1,104
2         


        
4条回答
  •  甜味超标
    2021-01-25 18:46

    One of my coworkers just give me the answer.

    You don't need the the ForEach Loop Container or the RecordSet Container.

    All you need is the Flat File Source and an OLE DB Command. Connect to your database and inside the OLE DB Command select the appropriate connection.

    In the Component Properties enter the following SQLCommand:

    exec ssis_createorder ?, ?, ? 
    

    The "?" are place holders for the parameters.

    Next under the Column Mappings tab map the .csv file columns to the stored procedure parameters.

    You are finished go ahead and run the package.

    Thanks Gary if you were on StackOverFlow I would give you an upvote and accept your answer.

提交回复
热议问题