Solved

prevent import of empty rows from Excel

Posted on 2008-06-20
1
907 Views
Last Modified: 2011-10-19
I'm using Enterprise Manager to import data from excel into a SQL server table into my database.  The import works but the process tends to import extra empty rows from the excel sheet that I do not want.  So for example: If my Excel spreadsheet has three rows of data that I want to import, it's actually importing rows 1 thru 4000.  What's the easiest way to prevent this.  I would prefer not to have to create a custom SQL statement if I can avoid it.  I much prefer using the wizard to transfer the information.
Any ideas would be appreciated.
0
Comment
Question by:xamian
1 Comment
 
LVL 19

Accepted Solution

by:
folderol earned 500 total points
Comment Utility
You need to save your wizard session as a dts package.  Save it to local server.  Click Data Transformation Services, Local Package, and right click your package, select design.

You need to change the radio button for Connection: to SQL QUERY, then modify the query with a where clause that will skip the blanks.  See attach screen shot.

For a painless ad hoc method, you need to clean up the range that is being imported.  The ODBC driver looks at usedrange, the rectangle of bottom row, rightmost column found with the same logic that sort and filter commands on the Excel Data Menu use to determine the table dimensions to manipulate, and it also will select a named range, if one exists.  You can get around this by pasting your data to a new sheet or new workbook before importing.  The SQL wizard will stop adding blank rows that appear below the data.
DTS-wizard.bmp
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

744 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

16 Experts available now in Live!

Get 1:1 Help Now