0

I am mapping columns in my SSIS package and I noticed that my table in SQL has decimal column but when I used decimal to map the excel columns with the table of my database I got an error. Do I need to use Numeric instead decimal?

paulsm4
  • 114,292
  • 17
  • 138
  • 190
jsancheti
  • 1
  • 1
  • Q: Did you resolve the problem? Did you remember to set [DataScale](https://stackoverflow.com/questions/24518534/dt-decimal-data-type-cutting-off-decimal/24519244) in your SSIS definition? And/Or use DT_NUMERIC? Please let us know. – paulsm4 Mar 25 '21 at 00:23

1 Answers1

0

Yes, they are different - numeric is "larger": 16 vs. 12 bytes; scale 0 - 38 vs 0 - 28; maximum precision 38 vs. 29:

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.

This table shows legal SSIS "cast" operations:

https://learn.microsoft.com/en-us/sql/integration-services/expressions/cast-ssis-expression?view=sql-server-ver15

legal SSIS cast operations

See also this link:

https://stackoverflow.com/a/24519244/421195

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

paulsm4
  • 114,292
  • 17
  • 138
  • 190