![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
My DTS package was working great yesterday, so I closed Enterprise Manager and started working on "prettying" up the excel file. Not anything too drastic, just validating cells and the like. I just updated all my Excel files and ran the package. Now the DTS package is importing 499 records for each Excel file. Each file only has 39 test records, and there are 3 of these files. So before there was only 117 records imported, now there are 1497 records imported. I have tried removing all validations from the Excel file, but it keeps doing it. Anyone know what is going on? Thanks, Drew |
#3
| |||
| |||
|
|
Ok... I figured out the problem, I selected all the cells of the Excel file down to Row 919, then hit Format Cells and hit General. I saved the file and then tried executing the DTS packge. This time it inserted 918 rows (keep in mind the first row are column names). So, how can I keep the Transform from inserting NULL values? Like if the whole record is NULL, then skip it... |
#4
| |||
| |||
|
|
Hi Drew, "Drew" wrote: Ok... I figured out the problem, I selected all the cells of the Excel file down to Row 919, then hit Format Cells and hit General. I saved the file and then tried executing the DTS packge. This time it inserted 918 rows (keep in mind the first row are column names). So, how can I keep the Transform from inserting NULL values? Like if the whole record is NULL, then skip it... the Excel provider can behave a little bit strange ;-) The import continues as long as there are rows with values. But unfortunately sometimes formating is interpreted as data, resulting in import of NULL values. The only way to avoid this, regardless of formatting, is by specifying a SELECT statement for the excel data where you define a WHERE clause which column should not be NULL. Just select the query option for the source of the transformation and use the Tablename shown in table dropdown above. HTH Helge |
#5
| |||
| |||
|
|
Also Helge has noted the Excel driver is quirky well what about this. If the Driver cannot determine the correct data type by sampling rows it will enter null values for the columns it deems to have broken the datatype. So in this case your data could be perfectly valid but the driver will NULL it because it got confused. Excel Inserts Null Values (http://www.sqldts.com/default.aspx?254) |
#6
| |||
| |||
|
|
Also Helge has noted the Excel driver is quirky well what about this. If the Driver cannot determine the correct data type by sampling rows it will enter null values for the columns it deems to have broken the datatype. So in this case your data could be perfectly valid but the driver will NULL it because it got confused. Excel Inserts Null Values (http://www.sqldts.com/default.aspx?254) Allan "Helge C. Rutz" <news050424 (AT) nurfuerspam (DOT) de> wrote in message news:news050424 (AT) nurfuerspam (DOT) de: Hi Drew, "Drew" wrote: Ok... I figured out the problem, I selected all the cells of the Excel file down to Row 919, then hit Format Cells and hit General. I saved the file and then tried executing the DTS packge. This time it inserted 918 rows (keep in mind the first row are column names). So, how can I keep the Transform from inserting NULL values? Like if the whole record is NULL, then skip it... the Excel provider can behave a little bit strange ;-) The import continues as long as there are rows with values. But unfortunately sometimes formating is interpreted as data, resulting in import of NULL values. The only way to avoid this, regardless of formatting, is by specifying a SELECT statement for the excel data where you define a WHERE clause which column should not be NULL. Just select the query option for the source of the transformation and use the Tablename shown in table dropdown above. HTH Helge |
#7
| |||
| |||
|
|
I tried the IMEX=1 trick, to no avail. I will try the suggested query method tommorow at work. I'll post back for future searchers... Thanks again for all your help. I searched about my problem, but only found the IMEX=1 method, and when it didn't work, I thought I would ask... Thanks, |
#8
| |||
| |||
|
|
Hi Drew, "Drew" wrote: I tried the IMEX=1 trick, to no avail. I will try the suggested query method tommorow at work. I'll post back for future searchers... Thanks again for all your help. I searched about my problem, but only found the IMEX=1 method, and when it didn't work, I thought I would ask... Thanks, the IMEX=1 trick won't help you here - that's the reason I haven't described it in the first reply - thats the solution for the second big problem ;-) When you have text files, you can easily stop the import at EOF, but with excel this is differen, because the provider must identify if there are still more rows with data. The problem arise from different type formatting in one column, because excel stores this different type information with the cell, causing the provider to interpret this cell as not empty. Try this: 1. open a new excel sheet. 2. insert some text in the first to cells/rows 3. goto cell 100 and format it with a different datatype like text or number 4. define a transform task with this source and import Now you should have imported 99 rows where 98 are NULL. So when you can't control the formatting of the excel sheet you should expect the worst and avoid this problem with a dedicated select statement.. @Allan: What about adding this information to your excel article? Helge |
![]() |
| Thread Tools | |
| Display Modes | |
| |