Document date/time addition change at compatibility level 110 #7152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At compatibility level 100 and below, the addition operator accepts an operand of type
DATE
,TIME
,DATETIME2
, orDATETIMEOFFSET
if the other operand has typeDATETIME
orSMALLDATETIME
. At compatibility level 110 and higher, an operand of typeDATE
,TIME
,DATETIME2
, orDATETIMEOFFSET
causes an error. For example:At compatibilty level 100:
At compatibility level 110:
I did not see this change described in the "Differences between Lower Compatibility Levels and Levels 100 and 110" in the ALTER DATABASE Compatibility Level (Transact-SQL) page. This PR adds it.
To confirm the behavior, you may find the following reproduction useful:
SQL script to test date/time addition behavior
Thanks for considering,
Kevin