Excel importing a single row through DTS failure -
03-12-2008
, 11:42 PM
Greetings
I have a successful DTS (SQL 2000!) package which imports many Excel
2003 timesheets. The columns contain numbers, strings and a date.
In DTS designer under Disconnected Edit, Connections, Excel, OLEDB,
Extended, Value I have:
Excel 8.0;HDR=YES;IMEX=1
The problem occurs when I have a single row (or a few rows)
I get an error like:
TransformCopy 'DTSTransformaion__2' conversion error: Conversion
invalid for datatypes on column pair 1 (source column 'Travel
time' (DBTYPE_WSTR), destination column 'TravelTime' (DBTYPE_R8)
So, it thinks it is a string coming in... but in fact it is a number
(float).
Now the IMEX=1 - I'm using that to get around null values which were
imported sometimes when the driver interpreted the Excel data type as
number (when it looks at the first 8 rows to get the datatype), but in
fact the data could be number or string, and was being put into the
database as a varchar..
However it is forcing this unknown type (of 1 or 2 rows) to become a
string.
I have tried: MAXROWSTOSCAN=0
and through the registry (http://support.microsoft.com/kb/189897/en-
us)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engi nes\Excel
Select TypeGuessRows and on the Edit menu click Modify.
set to 0
This doesn't help
Question: Is there any way to force the driver to take the first type
and stick with that?
I guess the other solution is to make sure there is enough data in the
excel sheet.. dummy data which can be selected out after the import is
done.
Regards
Dave |