dbTalk Databases Forums  

Importing data from Excel fails

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Importing data from Excel fails in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Leo
 
Posts: n/a

Default Importing data from Excel fails - 12-07-2005 , 09:37 AM






Hello all,

I am tryint to import data from Excel into a table in SQL using a DTS
package. I have not had to work with such a strangely formatted Excel file
before, but this is what happens:


Here is the general formatting of the excel file




FieldA FieldB FieldC FieldD
FieldF FieldG FieldH FieldI
Sales for quarter
Sales Redemptions

1234.67 6789.987

004 Growth Fund - CAD Mutual Fund 7.01 0.01 0.14
124,243 7.08 5.29
039 Fund - USD Mutual Fund 6.03 0.04
7 - 6.06 4.32
052 Growth Fund Fund 24.36 0.07 0.29
1,247,047 25.94 18.29


When I click on a destination table and hit Import, it looks at Field G and
H and determines the datatype to be varchar. Then I run the package and it
imports only the strings, but none of the float numbers.

however when I take out this line:

Sales for quarter
Sales Redemptions

1234.67 6789.987

it now looks at fields G and H and assigns them a float datatype. It imports
everything the way I want it to. So I assumed that when it's examining the
excel file, once the package encounters the
string 'Sales' and 'Redemptions' it assumes automatically that this should
be of varchar datatype.

But this is the strange part: I am running this directly on the server. When
I run the same exact thing from my machine's enterprise manager, it doesn't
care it still makes it a float datatype (without me taking out the first two
rows) and imports all float types fine and assigns NULLs to all other
strings.

How come this works on my windows xp enterprise manager but no the Servers
enterprise manager? Is there something on the System tables I have to
change?


Hope I explained this properly.

Thanks

leo




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.