Reputation: 22662
I have to load data from a AS400 DB2 system to SQL Server 2012. The extracted data is in a excel format from which I need to load to SQL Server. Referred IBM DB2/AS400 Subscribers
I have following decimal types in DB2/AS400.
What is the corresponding datatype in SQL Server 2012 for each of these?
What is the rationale behind selecting these datatypes ?
Upvotes: 0
Views: 1586
Reputation: 239734
In SQL Server, you don't get to define how much storage a decimal
takes up - SQL Server has fixed storage requirements. So I think we have to ignore the Byte Length, if I'm interpreting that as a storage size requirement. As to the rest, in SQL Server, you declare decimal
as:
decimal (p ,s)
Where p
is the precision (total number of digits in all parts of the number), and s
is the scale (number of digits to the right of the decimal point).
Since all of the types you've shown have a larger "decimal length" that "Dec Pos", I'm going to assume that these concepts map across directly to decimal
s precision and scale.
So type number 1 would be decimal(3,0)
and number 16 would be decimal(9,4)
.
Upvotes: 1