Solved

Skip rows in Excel using SSIS

Posted on 2010-09-14
6
997 Views
Last Modified: 2013-11-10
I have an Excel file that I am using as my source to create a CGL file in SSIS. I need to skip the first 5 rows every time and only want data from the following columns. F6,F7,F5,F64,F10,F86,F11,F61,F63,F167,F125,F87,F2 is there an easy way to accomplish this task in SSIS?
weekly-batch.xls
0
Comment
Question by:mburk1968
  • 3
  • 2
6 Comments
 
LVL 41

Expert Comment

by:ralmada
ID: 33673678
you can use the OpenRowset() property on the Excel Datasource. Something like Sheet1$A6:Z5000, check this link for more details:
http://weblogs.asp.net/mikebosch/archive/2007/10/26/ssis-skipping-rows-and-stripping-subtotals.aspx 
0
 

Author Comment

by:mburk1968
ID: 33673788
I get the following error attached. this is what I placed in OpenRowSet: HeaderTemplate$A6:FK100
Error.docx
0
 
LVL 41

Expert Comment

by:ralmada
ID: 33673876
try adding brackets there
[HeaderTemplate$A6:FK100]
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:mburk1968
ID: 33674003
Screen shot of error attached after using []
error.JPG
0
 
LVL 30

Accepted Solution

by:
Reza Rad earned 250 total points
ID: 33674341
Easiest would be to give each row a number (a bit like an identity in SQL Server) and then use a conditional split to filter out everything where the number <=5

reference:
http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/thread/97144bb2-9bb9-4cb8-b069-45c29690dfeb


0
 
LVL 41

Assisted Solution

by:ralmada
ralmada earned 250 total points
ID: 33674595
Well, I'm not sure why the suggestion I given in the link on my first comment didn't work, but alternatively you can try this link:
http://www.sqlis.com/sqlis/post/Row-Number-Transformation.aspx 
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question