Datetime2 in SQL 2014 Vs SQL 2022
0
votes
2
answers
152
views
Behaviour of column type 'DateTime2' between SQL 2014 and SQL 2022.
This was found when our application's calculation for datetime difference of columns being type DateTime2 went wrong.
Tried to find from google if there would be a specific setting in server property for datetime2 type of columns, but no luck.
Noticed - DateTime2 improvements
It is stated the behaviour is expected.
Datetime2 with SQL 2014 is of precision 7 with only first 3 digits updated whereas its now 7 with SQL 2022 updated for all 7 digits. And so calculations with the datetime2 fields are turning mess after upgrading.
Now, there are lot of columns in many tables which were defined as datetime2. It would take time to fix correction to all queries, application codes.
Will there be any simple fix to this?
Asked by Meera K
(81 rep)
Nov 12, 2024, 05:18 AM
Last activity: Nov 20, 2024, 12:54 PM
Last activity: Nov 20, 2024, 12:54 PM