3

I'm currently importing a table from MYSQL to MSSQL. There's a column there for storing date, only it's stored as an number. When i import it to MSSQL i get it in as an int data type.

When i try to convert that to datetime I get an :

Arithmetic overflow error converting expression to data type datetime.

Since i'm using MSSQL 2005 I can't use datetime2 and fit it so it does not overflow.

Is there a way to trim that date stored as an int so it does not overflow the datetime format ?

Paul
  • 714
  • 2
  • 6
  • 19

1 Answers1

3

The MSSQL datetime data type can take values from January 1, 1753 to December 31, 9999. The integer equivalents for those values are -53690 and 2958463 respectively. Trying to convert integer values outside that range would cause the arithmetic overflow.

Ryan Bolger
  • 16,472
  • 3
  • 40
  • 59