x

Why is SSIS choking on Comma separators in numbers?

I am trying to import a tab-delimited text file using SSIS and it is choking on all the numeric fields because they numbers have comma-separators (e.g. 1,000.54). I keep getting this error:

The data conversion for column returned status value 2 and status text "The value could not be converted because of a potential loss of data.".

This is happening with numeric fields and with integer fields. Is there no way to tell SSIS to ignore the comma? Seems like there would be, given the frequency of putting commas in numbers.

Please help - as I am having to open each file in Excel and highlight the columns and de-select the comma separator checkbox in the format dialog.

Thanks! Scott Edwards Pasadena, CA

more ▼

asked Mar 21, 2010 at 08:59 PM in Default

avatar image

ScottEdwards2000
56 3 2 5

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

2 answers: sort voted first

I don't know of an option for this, particularly as different cultures use commas and periods differently. For example, you often find "1 000,54" for the number you quoted earlier, or "1.000,54".

Trying pulling them into a string field, and then stripping the comma out and converting to number within the data flow.

more ▼

answered Mar 21, 2010 at 11:45 PM

avatar image

Rob Farley
5.8k 16 22 28

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

In the text file source configuration select the columns as tab seperated instead of comma seperated.Also find and replace all the commas in the file.

Thanks, Kannan

more ▼

answered Oct 22, 2010 at 09:08 AM

avatar image

aRookieBIdev
2.8k 56 65 71

This doesn't work - I already had that option selected. But thanks for the help anyways.

Mar 17, 2011 at 05:33 PM ScottEdwards2000
(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.

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:

x1152
x70

asked: Mar 21, 2010 at 08:59 PM

Seen: 4464 times

Last Updated: Mar 21, 2010 at 08:59 PM

Copyright 2016 Redgate Software. Privacy Policy