Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
THNQdigital
Starting Member
15 Posts |
Posted - 2005-05-03 : 17:10:02
|
hi,i have a package thAt loads an excel file to a table. Simple and works just fine.Let's say my excel file has 10 rows and i run the dts and 10 rows get loaded.Now, 2nd time i open the excel file and delete last 8 rows and retain only first 2 rows and save the file. I run the DTS package again and it says 10 rows loaded again.. when i see the table, NULL is loaded in the rest of the 8 rows.. how can avoid this..? please let me know.Thanks for the helpTHNQdigital |
|
jsiedliski
Yak Posting Veteran
61 Posts |
Posted - 2005-05-03 : 20:03:17
|
Are you actually deleting the ROWS or just the data in the rows? The JET Driver (driver SQL uses to connect to the Excel file) thinks there is still data in those rows. I think if you truly deleted the rows (and you may want to delete several rows below the 8 as well), ti should go away. A seccond option would be to write a delete statement which executes after the import is done. Assuming you have 4 columnsDELETE FROM my_table WHERE a IS NULL AND b IS NULL AND c IS NULL and d IS NULL.That way you do not have to worry about the JET driver thinking there are rows which you do not consider legitimate records.:) |
 |
|
THNQdigital
Starting Member
15 Posts |
Posted - 2005-05-04 : 11:17:31
|
Wonderful.. That was the problem.. and i like the way to check for nulls and delete them .. that way you don't care how JET is treating excel values.. good stuff.. and works well.. thanksTHNQdigital |
 |
|
|
|
|