Solved

Why does my SSIS data flow from Excel to SQL table produce extra rows?

Posted on 2010-09-10
3
292 Views
Last Modified: 2012-05-10
Hi,

I have an Excel file that contains 47394 rows plus one row at the top containing the column headings. If I hit Ctrl-End in Excel, cell F47395 is activated, which is what I expect. I am using this Excel file as the data source in a SSIS package data flow task. The data flows into a SQL table via a Data Conversion transform and an OLE DB destination. All 47394 rows are flowing into the SQL table correctly but what's baffling me is an additional 128 rows entering the SQL table, each of which is full of NULLs.

Can anyone explain why this is happening and more importantly how to prevent it happening within my SSIS package? I suppose I could add an Execute SQL task that deletes all rows with a NULL column, which could follow my data flow. However, this seems a less than elegant way of doing it and I was wondering if it can be managed within the data flow task.

Many thanks in advance.
0
Comment
Question by:irb56
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
vdr1620 earned 500 total points
ID: 33647819
That might happen because Excel had more number of rows Previously and was replaced with data with Less number of rows..

In the Excel Source ..change the Data Access mode to SQL command and Write the SQL to get the data from EXCEL file with a WHERE Clause in the End (Specify a columnName where you don't have any NULLS in the Data Or Use Multiple Columns in Where clause with AND ) LIKE

WHERE ColumnName IS NOT NULL

If you problem writing the Query.. Click on Build Query to build your Query and add a Where Clause
0
 

Author Closing Comment

by:irb56
ID: 33648042
Excellent! It worked perfectly, thank you.  :-)
0
 
LVL 16

Expert Comment

by:vdr1620
ID: 33648097
Glad it helped..
Suggestion.. post questions related to SSIS in SSIS zone ..so that right experts can help you better and faster
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

615 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