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.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 DTS Importing Excel spreadsheets - Warning/discuss

Author  Topic 

M.E.
Aged Yak Warrior

539 Posts

Posted - 2002-11-06 : 13:11:59
This has happened to me several times and I've seen posts on this forum about it in the past. It seems to be a bug with importing from excel.

All of our reference tables follows the exact same format
Reference value, Description, legacy_code (all varchars of various length)

Our spread sheet would contain values like
gas, gas well, 01
s gas, sour gas well, 02
oil, oil well, 03

this goes on for about 100 columns or so. A simple import should populate this table.. right? well.. not quite. For some unknown reason, some legacy codes are reported as nulls. Our table would be
gas, gas well, 01
s gas, sour gas well, null
oil, oil well, null

Why these are reported as nulls, I got no clue. It seems to be in groups (all legacy codes > 15 are null.. or all ones <10 are null... it seems to be random).

The only solution we've found is to drop the spreadsheet and completely recreate it. We've tried altering the column data types in excel, but nothing seems to work (other than a complete recreate of the excel spreadsheet). Any ideas on this one would be helpful... it's got us quite well baffled

Mark

-----------------------
SQL isn't just a hobby, It's an addiction

jasper_smith
SQL Server MVP &amp; SQLTeam MVY

846 Posts

Posted - 2002-11-06 : 13:53:11
Is this relavent at all ? Maybe not but try the 2nd part
[url]http://www.sqldts.com/default.aspx?6,222,254,0,1[/url]


HTH
Jasper Smith
Go to Top of Page

M.E.
Aged Yak Warrior

539 Posts

Posted - 2002-11-06 : 15:49:17
Thankyou for you contribution jasper

I've seen this article before and it does have some relevance. However in our situations, we have a table written as
Value, legacy code
value,01
value,02
value,03
value,04
value,05
value,06
value,07
value,08
value,09
value,10
value,11
value,12
value,13
value,14
value,15
value,16
value,17
value,18
value,19
value,20
value,21


All the values will load correctly. All legacy codes load correctly except 15-21 which are recorded as nulls. If it was just the first 8 that didn't load or all the ones after....


I will look a little further into it with option 2... We'll see what I can get from it. What I don't understand is why recreating the spreadsheet seems to get rid of the problem.

-----------------------
SQL isn't just a hobby, It's an addiction
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-11-06 : 16:35:15
I have had very subtle and obscure bugs come up in Excel whenever a worksheet is changed. Some settings are made at the time the worksheet is created and first saved, like the print range, that sometimes reset to another setting. The same applies for named ranges, or any range that was used in a formula and then updated afterwards. Actually, the best example is to use the Goto feature and choose Last Cell. This never changes no matter how much data you remove; it always goes to the last cell that ever contained a value on the worksheet, even if you completely clear it. Likewise, if you only had 15 rows originally, that might've been saved somewhere in the worksheet and DTS is using it instead of scanning the sheet.

Basically, when that happens the worksheet is "corrupted" and you'll have to create new sheet to fix it. You *might* be able to fix it by using a named range for the data:

http://www.sqldts.com/default.aspx?6,101,243,0,0

You can write an Excel macro that redefines that named range, so if people edit the workbook it can run automatically and set the range to encompass all of the appropriate data.

Go to Top of Page

M.E.
Aged Yak Warrior

539 Posts

Posted - 2002-11-06 : 18:39:15
Hmmm, interesting. Actually, all the cases of this happening occoured on a spreadsheet that had several revisions done on it. This would also explain why deleting it and reentering it in a new spreadsheet would correct the problem. I'll have to go through all the other ones that have had several revisions made to it and see if they are experiencing simular problems

Geez thats an obscure one ain't it?

-----------------------
SQL isn't just a hobby, It's an addiction
Go to Top of Page
   

- Advertisement -