DATETIME2FROMPARTS constructs a complete typed timestamp. Match fraction units to precision and preserve valid calendar components.
XML exist: A Present Boolean Expression Still Exists
XML exist tests a nonempty XQuery result. Even false() returns a value, so use a node predicate to test presence and preserve NULL XML input.
JSON_OBJECT: Decide Whether Missing Values Become Null
JSON_OBJECT constructs a typed object payload. Choose null or absent properties deliberately and preserve empty strings as present values.
DATEADD Fractional Numbers: Truncate Before Addition
DATEADD fractional numbers are truncated, not rounded. Compare positive and negative day additions while preserving an explicitly typed date input.
geometry STTouches: A Shared Boundary Is Not Interior Overlap
geometry STTouches tests whether shapes meet without their interiors intersecting. I keep that predicate separate from a general intersection check. Sharing an edge and sharing an area are different spatial relationships.
CAST to date: Remove Time Without Moving the Day
CAST to date keeps the calendar day from a typed datetime2 value. The example preserves the original time and contrasts actual removal with a display that merely hides it.
LEAD Defaults: Missing Rows Differ From NULL Values
LEAD defaults handle a missing following row. Keep that boundary separate from a present row containing NULL and choose replacement policy explicitly.







