smallmoney stores a bounded numeric amount with four fractional digits. These explicit conversions show retained and changed digits without making a financial storage recommendation.
geometry STSymDifference: Keep the Parts Outside the Overlap
geometry STSymDifference keeps points belonging to either input while excluding their shared portion. I use it when both sides’ exclusive regions matter. Directed subtraction would answer a different question about only one side.
Derived Table, CTE or View: Choose the Scope
A derived table, CTE and view can express the same grouped result while offering different scopes. Compare complete outputs with duplicates and NULLs, then choose a statement-local expression or a saved definition for the task.
FIRST_VALUE IGNORE NULLS: Find the First Available Value
FIRST_VALUE IGNORE NULLS selects the first present value through the current row. Preserve source rows and distinguish first from latest.
Preventing Overlapping Date Ranges in a Table
Detect overlapping date ranges with joins and window queries, use half-open endpoints, and enforce the rule with a multirow trigger.
geometry STCentroid: The Geometric Center Is Not an Interior Promise
geometry STCentroid returns a polygon’s geometric center, but that point is not a promise of interior placement. I keep the center calculation separate from an interior test. A holed region makes that distinction visible.
Environment Settings in SSIS Projects
SSIS projects can deploy one package across environments by using project parameters, SSISDB variables, and tested references.







