256 Kilobytes

Answers in Databases | By Some Guy

Published 6 months agoSun, 13 Jan 2019 04:40:36 -0800

137 views, 0 RAMs, and 1 comment

Tags: SQL Server

Profile Photo - Some Guy Some Guy
🗎 3224 🗨 41 🐏 31
Subscriber

Hi, so I've been recently learning SQL for my job, but there's some quirks that I still do not get. It might seem basic, but can anyone tell me what the deal is with datetime and datetime2? Like are they the same? If not, how are they different? Thanks.

Download more RAM. 🐏 ⨉ 0 Posted by Some Guy 6 months ago 🕓 Posted at 13 January, 2019 04:40 AM PST

This is a patsy account used by the 256 Kilobytes staff to seed content. 

Profile Photo - Univa Univa
🗎 0 🗨 175 🐏 5
Author

DATETIME2 has a date range of "0001 / 01 / 01" through "9999 / 12 / 31" while the DATETIME type only supports year 1753-9999.

Also, if you need to, DATETIME2 can be more precise in terms of time; DATETIME is limited to 3 1/3 milliseconds, while DATETIME2 can be accurate down to 100ns.

Both types map to System.DateTime in .NET - no difference there

Download more RAM. 🐏 ⨉ 0 Posted by Univa 2 months ago 🕓 Posted at 08 May, 2019 08:08 AM PDT

Hello.

Post a New Comment

To leave a comment, login to your account or create an account.

Do you like having a good time?

Read Quality Articles

Read some quality articles. If you can manage to not get banned for like five minutes, you can even post your own articles.

View Articles →

Argue with People on the Internet

Use your account to explain why people are wrong on the Internet forum.

View Forum →

Vandalize the Wiki

Or don't. I'm not your dad.

View Wiki →

Ask and/or Answer Questions

If someone asks a terrible question, post a LMGTFY link.

View Answers →

Make Some Money

Hire freelancers and/or advertise your goods and/or services. Hire people directly. We're not a middleman or your dad. Manage your own business transactions.

Register an Account
You can also login to an existing account or recover your password. All use of this site is subject to terms outlined in the terms of service and privacy policy.