Solved

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

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

734 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