November 2, 2006 at 8:30 am
I have come across an interesting situation importing from an excel spreadsheet. We have a customer that places and excel file in an ftp folder which we upload to the server via dts....
It is a simple import, however, the last load gave us interesting results. The person had sorted the data so that the first 5 columns of data were populated, the next two were null values and the last column was populated, looking like this:
EMPLOYEE # | CRAFT CODE | Start Date | PPE Date | REG HOURS | PREM. PAY TYPE | PREM. PAY HRS | WO # |
1010 | 400JNT-07 | 10/28/06 | 10/31/06 | 2 | 1086 |
There were about 150 records with null values in the [pay type] and [prem pay hrs] fields prior to a record contaning data in these fields.
When the data was loaded, the uploaded table had null values in the all the records [prem pay hrs] field, when the data clearly did have values.
I have found that if there is a record that has values in the first 25 records imported, the upload works perfectly.
Has anyone else come across this? Is this a known bug with sqlserver 2k?
November 2, 2006 at 10:20 pm
Nope, not a bug. It's also not SQL Server's fault. It is the behavior, by design, of the ISAM used to connect to Excel and standard delimited text files. In general, Excel columns aren't typed, so the type is derived based on the first 8 rows in the column. If there is nothing but Nulls in the first 8 rows, it thinks that the entire row is Null.
There is an excellent article on SQLDTS.com that explains your options on how to handle this.
http://www.sqldts.com/default.aspx?254
November 3, 2006 at 2:07 am
This issue has been on the agenda before.
I think the simplest way to get rid of the design problem importing Excel files with
DTS is to save the Excelfile as a text file and import that file instead.
November 3, 2006 at 6:48 am
Thanks Robert...I figured it was something like that.
Gosta, I did exactly what you suggested...they have to provide a csv file.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply