Wednesday, March 21, 2012

Import excel file to database

Hai,

I am new to SSIS 2005.

Now i would like to use the foreach loop structure in an SSIS package to
loop through however many Excel files are placed in a directory and
then perform an import operation into a SQL table on each of these
files sequentially.

But i dont know how to get start?

Can anyone guide me on this task?

Thanks.

Step (1) and (2) used from http://rafael-salas.blogspot.com/

If Each Excel File has a Single Work Sheet, The following will be the method:

1) In the foreach loop properties use the following settings

In Collections tab,

Set Enumerator to "Foreach file Enumerator",

Under enumerator Configurations, Specify the Folder and Filter files with *.xls

In Variables Mapping tab,

Under Variable Column Select A Variable Name - User::ExcelFilePath(of String type, ForEachloop Scope) and Index Value 0.

2) Under the Dataflow, Under Source OLEDB Connection manager properties, use the expression builder to assign the Connection String Value to @.[User::ExcelfilePath].

Connect to source to your Destination SQL Server

For the rest of the steps, we pursue from step 11 given by DouglasL'S Answer

No comments:

Post a Comment