what is the equivalent of Datetime2 of mysql in mssql ?
Asked
Active
Viewed 6,469 times
4
-
it's probably `DateTime`. you can check here for more information.https://stackoverflow.com/questions/409286/should-i-use-field-datetime-or-timestamp – A.D. Nov 15 '17 at 09:02
-
1MySql documentation doesn't seem to mention `DateTime2`. Sql Server does have `DateTime2` - are you sure you didn't get your databases mixed up? – Zohar Peled Nov 15 '17 at 09:17
1 Answers
5
MySQL 5.7 has fractional seconds support for TIME, DATETIME, and TIMESTAMP values, with up to microseconds (6 digits) precision: https://dev.mysql.com/doc/refman/5.7/en/fractional-seconds.html
Datetime2 Precision, scale 0 to 7 digits, with an accuracy of 100ns. The default precision is 7 digits https://learn.microsoft.com/en-us/sql/t-sql/data-types/datetime2-transact-sql
Datetime2
is a term used in MS SQL Server. A MS SQL Server column defined as datetime2(6)
is the equivalent to a MySQL 5.7 datetime
or timestamp
column.

Paul Maxwell
- 33,002
- 3
- 32
- 51
-
3Would downvoters please identify the incorrect facts. Then I could address their concerns. All I have sought to do is find the closet match of date/time precision in 2 databases – Paul Maxwell Aug 29 '18 at 07:25