Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2008-10-02
3
611 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
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to SQL Trace a SPECIFIC query 24 84
dbcc checkdb datawarehouse 2 61
Update from TABLE-A to TABLE-B 5 56
Accessing variables in MySQL query 4 25
I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

809 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