x

SSIS Excel Import ALWAYS NUMBERS WITH DECIMALS

HELP!!!

I know what to do to import mixed data types or force the import to treat everything as a text. But what about the other way round???

I have spent weeks (really!) to search for a good solution to import Excel data as numbers. It sounds so simple and I am almost going crazy because I just don't see a way to achieve it.

Imagine this: There are 2 columns A and B which contain account codes and account descriptions. This will be imported as text and I am fine with it. But then I have 12 more columns C to N which should contain only numbers.

Unfortunately these 12 columns have text in the first 5 rows. It might happen that in one whole column there are only 1 or 2 numbers further down in the rows. So the majority is text.

But I need to import it as numbers. Because when it is imported as text it will take the format of the Excel sheet. And this is really bad because I am loosing decimals and negative values appear differently.

Unfortunately I cannot rely on the formats because I am getting more than 300 Excel sheets from all the continents.

Example: If -123.45 is formatted as (123) I will get (123) if I import it as text. But I really need the correct value which is -123.45. Or am I misunderstanding something completely?

Please let me know if it is unclear.

Thanks a lot in advance for your help!
more ▼

asked Sep 05, 2012 at 02:26 PM in Default

matmar gravatar image

matmar
0 2 2 2

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

So is SSIS converting all these columns to text and you would like them to be numeric? Is that correct?

I believe there are two solution: 1. Import it into SQL as Text and then use Cast/Covert to switch data types 2. Force SSIS to use a float data type. Including a picture on this.

alt text

Good Luck Kash

ssis-pic.jpg (72.3 kB)
more ▼

answered Sep 11, 2012 at 08:27 PM

Kash gravatar image

Kash
10 1

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x937
x115
x18
x6

asked: Sep 05, 2012 at 02:26 PM

Seen: 2052 times

Last Updated: Sep 11, 2012 at 08:27 PM