Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DT_Decimal Data Type Cutting off Decimal

I have a flat file source that grabs a decimal value for the column Note Amount. The Source system specifies that this is a DECIMAL(12,2) file. I have the column in SSIS set to be DT_Decimal

File

The particular Flat file has a value of 122735.13 for one of it's amounts. However if I place a data viewer on the flow after the source it seems to be cutting the decimal off.

DataFlow

ResultsCut

Any idea why this is happening? For reference I'm going to a Decimal(12,2) SQL Server 2012 Database.

like image 410
Zane Avatar asked Jul 01 '14 20:07

Zane


People also ask

Which data type will allow decimal numbers?

The Decimal data type provides the greatest number of significant digits for a number. It supports up to 29 significant digits and can represent values in excess of 7.9228 x 10^28. It is particularly suitable for calculations, such as financial, that require a large number of digits but cannot tolerate rounding errors.

What type of data type is a decimal?

The decimal data type is a machine-independent method that represents numbers of up to 32 significant digits, with valid values in the range 10 -129 - 10 +125. When you define a column with the DECIMAL( p ) data type, it has a total of p (< = 32) significant digits.

Can integer data type have decimal?

Decimal is not a floating-point data type. Decimal numbers have a binary integer value and an integer scaling factor that specifies what portion of the value is a decimal fraction.


1 Answers

Well it was pointed out that I needed to add the Scale that was missing.

Decimal

Or even better do as this suggests and switch to numeric where I can set precision and scale.

Numeric

like image 153
Zane Avatar answered Sep 30 '22 17:09

Zane