Thursday, 24 January 2019

Skip n rows from excel and load the data into the database using SSIS

My requirement is to load the excel data into the database. I am getting the excel file from the business in that excel sheet first 5 rows having header and site details. Data starts from the 6th row so we need to read the data from 6th rows onwards. Below is a simple example file.
  

 Let’s see it in this demo
Taking Dataflow task  
In Data flow, I am taking Source as excel
  
Creating an excel connection.
  
Click ok. Select Data access mode as SQL Command.
  
Now we need to write the sql query to pull the data from excel sheet.
  
Select * from [100 Records$A6:AK10000]
If we want to read the whole sheet then we can write SQL query as below
Select * from [100 Records$]
But we want to get the data from the specified range so we will provide the range.
Click ok.
Now I am taking destination as OLEDB and doing the mapping.
  
Before running this package records in the database.
  
Now running this package.
  
100 rows loaded successfully.
Records in the database.


No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts