The. Net Framework and SQL Server 2005 chaotic time maximum minimum

Source: Internet
Author: User

http://blog.csdn.net/jiwenyi163/article/details/2973100

The. Net Framework and SQL Server 2005 chaotic time maximum minimum

Before I talked to Dotjum. Microsoft had a very inconsistent minimum maximum time for DateTime and SQL Server 2005, and did not expect anyone to have touched the same trap.

References:

C # Datetime.minvalue is isn't the same as Sqldatetime.minvalue Caution when passing Null or DateTime into Store Procedure

And that's actually one of the things I've been talking to a lot of people about: procured our material, the IT technology problems we meet are most unlikely to be met for the first time in the world. In other words, for the most part, we have encountered an IT technology problem that someone in this world must have met and already resolved! In simple words, use the keyword search to solve the problem.

Net Framewrok,
Datetime.minvalue = 0001/01/01 00:00:00
SqlDateTime.MinValue.Value = 1753/01/01 00:00:00

In SQL Server 2005,
DateTime Minimum value = 1753/01/01 00:00:00
smalldatetime minimum value = 1900/01/01 00:00:00

Net Framewrok,   
DateTime.MaxValue
SqlDateTime.MaxValue.Value = 9999/12/31 23:59:59.997
In SQL Server 2005,
DateTime max = 9999/12/31 23:59:59.997
smalldatetime Maximum Value    

Alas! Isn't it a bit confusing? A little careless, there may be Overflow problems that will produce

The. Net Framework and SQL Server 2005 chaotic time maximum minimum

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.