Solved

Skip rows in Excel using SSIS

Posted on 2010-09-14
6
983 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now