Solved

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

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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

19 Experts available now in Live!

Get 1:1 Help Now