Solved

prevent import of empty rows from Excel

Posted on 2008-06-20
1
911 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
ID: 21834114
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

911 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