Solved

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

Posted on 2008-10-02
3
582 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:
bhess1 earned 500 total points
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In today’s complex data management environments, it is not unusual for UNIX servers to be dedicated to a particular department, purpose, or database.  As a result, a SAS® data analyst often works with multiple servers, each with its own data storage…
This article describes some very basic things about SQL Server filegroups.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

12 Experts available now in Live!

Get 1:1 Help Now