Excel to SQL Server column format issues -
12-13-2004
, 01:03 PM
Hello,
I need to import some data from Excel into SQL Server using DTS. I've
implemented the code from www.sqldts.com that imports a named range
from a worksheet, and it's working perfectly (thank God for
www.sqldts.com!).
However, there is one column in my range that contains both numbers and
characters. The destination column in my table is a VARCHAR. For some
reason the data pump I have set up can't handle both types of data; if
I manually format the column as a number, I get all the numbers but no
character. If I manually format the column as text, I get all the
characters but no numbers. I need both (they are account numbers). I
have yet to figure out how to get all the data from the column into my
table.
Does anyone know a way to configure the data pump so that it will
handle both character and numeric data from an Excel spreadsheet? Or,
if there is a way to format the column from an ActiveX task, that would
work as well. I do not have control over how the spreadsheets are
initially presented to me - that is, I can't mandate that the users
save the spreadsheets any particular way.
Thanks in advance!
Mark |