float vs real – data types in SSIS

float is always not accurate…so is real….

use dt_numeric or dt_decimal for accurate decimal points.

precision & scale:

precision – total number of digits in the number
scale – number of digits minus the digits after the decimal

— use DT_NUMERIC with accruate precision & scale to avoid rounding issues in SSIS
— SSIS datatypes – http://msdn.microsoft.com/en-us/library/ms141036.aspx

Precision is the number of digits in a number. Scale is the number of digits to the right of the decimal point in a number. For example, the number 123.45 has a precision of 5 and a scale of 2.

DT_DECIMAL

An exact numeric value with a fixed precision and a fixed scale. This data type is a 12-byte unsigned integer with a separate sign, a scale of 0 to 28, and a maximum precision of 29.

DT_NUMERIC

An exact numeric value with a fixed precision and scale. This data type is a 16-byte unsigned integer with a separate sign, a scale of 0 – 38, and a maximum precision of 38.
In SQL Server, the default maximum precision of numeric and decimal data types is 38

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>