Wednesday, January 20, 2021

DATETIME vs DATETIME2 - 5 reasons why DATETIME2 is better

Recommendation first: if you are not sure whether to choose Datetime or Datetime2 the answer is choose Datetime2. Why?
  1. Higher precision – up to 7 fractional digits for datetime2 vs 3 for datetime 
  2. Higher level of accuracy – datetime rounds the last digit to an increment of .000, .003 or .007 whereas datetime2 supports accuracy of 100 nanoseconds 
  3. Wider range of values – datetime2 supports dated from 0001-01-01 00:00:00 to 9999-12-31 23:59:59.9999999 whereas datetime supports dates from 1753-01-01 00:00:00 to 9999-12-31 23:59:59.997 
  4. Space requirements – depending on the fractional precision you require datetime2 needs from 6 Bytes to 8 bytes of space whereas datetime requires 8 bytes 
  5. Compliance with standards: datetime2 is compliant with both ANSI and ISO 8601 whereas datetime is not.
For a more in depth review of those reasons you can check our other post here.

Related Posts:

  • One-click SQL Data Compare Comparing and synchronizing data in two SQL Server databases is most of the time a fairly straight forward process: you select the databases you want to compare; xSQL Data Compare maps the tables and views automatically, ide… Read More
  • Listen to your customers, or not!The most vocal customers you have, those that download the latest builds of your products, those that discover the bugs in your code, and take the time to make their opinion of your products known to you and sometimes to the … Read More
  • Find SQL Server Database Objects quickly with the free xSQL Object Search As a database administrator or developer you often need to search for database objects like tables, stored procedures, views etc., in one or more databases. You might be trying to find a stored procedure the name of which co… Read More
  • Download SQL Server 2000 Surprisingly, there are still a lot of people asking "where can I download SQL Server 2000 from?" so here are a couple of helpful links: MSDE 2000 (Microsoft SQL Server Desktop Engine) can be downloaded from http://www.micr… Read More
  • LinkedIn ads - puzzledFrom a software vendor's point of view, or any vendor's point of view for that matter, LinkedIn appears to be an ideal platform for promoting products. There are not many places where the audience by definition is exactly wha… Read More

0 comments:

Post a Comment