title: SQL Server Datatypes for DB2/AS400 Decimals with byte length and Decimal Length
body: <p>I have to load data from a AS400 DB2 system to <strong>SQL Server 2012</strong>. The extracted data is in a excel format from which I need to load to SQL Server. Referred <a href="http://msdn.microsoft.com/en-us/library/aa237110%28v=sql.80%29.aspx" rel="nofollow">IBM DB2/AS400 Subscribers</a></p>
  
  <p>I have following decimal types in DB2/AS400.</p>
  
  <ol>
  <li>Byte Length = 2, Decimal Length =3, Dec Pos = 0</li>
  <li>Byte Length = 3, Decimal Length =5, Dec Pos = 2</li>
  <li>Byte Length = 3, Decimal Length =3, Dec Pos = 0</li>
  <li>Byte Length = 3, Decimal Length =5, Dec Pos = 4</li>
  <li>Byte Length = 4, Decimal Length =4, Dec Pos = 0</li>
  <li>Byte Length = 4, Decimal Length =6, Dec Pos = 3</li>
  <li>Byte Length = 4, Decimal Length =7, Dec Pos = 4</li>
  <li>Byte Length = 5, Decimal Length =5, Dec Pos = 0</li>
  <li>Byte Length = 5, Decimal Length =9, Dec Pos = 4</li>
  <li>Byte Length = 6, Decimal Length =11, Dec Pos = 0</li>
  <li>Byte Length = 6, Decimal Length =11, Dec Pos = 2</li>
  <li>Byte Length = 6, Decimal Length =11, Dec Pos = 4</li>
  <li>Byte Length = 6, Decimal Length =11, Dec Pos = 5</li>
  <li>Byte Length = 7, Decimal Length =13, Dec Pos = 4</li>
  <li>Byte Length = 7, Decimal Length =7, Dec Pos = 2</li>
  <li>Byte Length = 9, Decimal Length = 9, Dec Pos = 4</li>
  </ol>
  
  <p>What is the corresponding datatype in SQL Server 2012 for each of these?</p>
  
  <p>What is the rationale behind selecting these datatypes ?</p>