Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using DTS to import data from an excel spreadsheet SQL version 2003 version 8.0

Posted on 2008-10-02
3
Medium Priority
?
634 Views
Last Modified: 2012-06-21
I've been using this spreadsheet for quite sometime, but with a different company.  I can't seem to get it to work now.  Please see attached error message and Excel file
DTS-Error-Message.doc
New-Prop-Template.xls
0
Comment
Question by:rhonlw83
3 Comments
 
LVL 32

Accepted Solution

by:
Brendt Hess earned 2000 total points
ID: 22638245
The Excel DTS import does not like certain fields where they contain all numbers, but the field is formatted as text.  I have found it easier to prepend on a single quote on any field containing numeric text to ensure that the DTS package succeeds.

Here is a snippet of Excel macro code that will ensure that the values in the cells will be treated as strings by the DTS import routines.  Try running it against that column, then run the import.  I believe your import will succeed.
Sub Textify()
'
' Select the last cell in the column that needs to be textified
' So, if data exists in column C, go to the last cell in that 
'   column with data in it, then run the macro. 
    Do
        If ActiveCell.Row = 1 Then Exit Do
        If Left(ActiveCell.FormulaR1C1, 1) <> "'" Then
            ActiveCell.FormulaR1C1 = "'" & ActiveCell.FormulaR1C1
        End If
        ActiveCell.Offset(-1, 0).Activate
    Loop
End Sub

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

886 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