Solved

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

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
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 …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

808 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