Thursday, October 25, 2012

Minimum & Maximum Year in MS SQL

You guys remembered the millennium bug, in year 2000?  It's where some people fear, the computers will crash, and planes will also crash when in flight, because of the bug on the year, where the computers only allow until year 2000.  Well I didn't believe it, and wasn't affected by that scare.

But, there is such things as limits I supposed.

In MS SQL 2000 & 2005, they have the following limits:

  • minimum date of 1753-01-01 00:00:00.000 
  • maximum date of 9999-12-31 23:59:59.999


This was fixed in MS SQL 2008, where they have the following limits to the dates:

  • Minimum date: 0001-01-01 00:00:00.000
  • Maximum date: 9999-12-31 23:59:59.999


If we ever reached that year 10000, then they will probably panic again like the millennium bug scare.  Or people will be cyborgs with numbers on their names and probably fear they will be affected by the limit.