Few days back, I discovered this error that SQL Server DateTime can hold only dates between 01-Jan-1753 12:00:00 AM to 31-Dec-1999 11:59:59. While performing a random data entry in SQL Management Studio, it alerted me this error message:

The text version of Error Message:
—————————
Microsoft SQL Server Management Studio
—————————
No row was updated.The data in row 1 was not committed.
Error Source: System.Data.
Error Message: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.Correct the errors and retry or press ESC to cancel the change(s).
—————————
OK Help
—————————
If you are a Web Developer, then it becomes important for you to handle this exception in your application. Based on the feasibility of your Application Design, you can follow one of these common methods:
- Validate the date range using a client side script (Javascript or AJAX)
- On the Server Side script – ASP.NET, PHP, JSP etc.
- You can also catch this error at the back-end layer, if your design includes Stored Procedures.
So far, I have verified this problem in SQL Server 2005, SQL Server 2008 and SQL Server 2008 R2.
Next time, when I get time I will explore any such Date Time value limitation in other popular databases.
I am just guessing that Mainframe Databases will not have such limitations, because they store the data in plain text. Hope some Mainframe expert reads this posts and confirms my assumption
- Brain LOGs

