Solved

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

Posted on 2010-09-10
3
290 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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