hierarchyid ordering follows the hierarchy value. Sorting rendered path text can arrange numeric-looking components differently, so keep presentation text separate from traversal order.
ROWS vs RANGE in Window Frames: Why Running Totals Differ
Compare ROWS vs RANGE for running totals, handle tied sort values, write explicit frames, and check worktable reads on your server.
XML sql:column: Compare XML With a Relational Value
XML sql:column passes a typed relational value into XQuery. Keep node existence separate from a missing document and a scalar Boolean.
XQuery Node Identity: Equal Text Can Be Different Nodes
XQuery node identity compares source nodes, not their text. Use is beside text equality to distinguish repeated values from the same node.
SQL SERVER – How to Use Decode in SQL Server?
CASE expresses the DECODE mapping in this SQL Server example. I keep the named matches and default value explicit.
geometry STDistance: Measure the Closest Points of Two Shapes
geometry STDistance measures the shortest distance between points belonging to two represented shapes. I compare an interior gap with an endpoint gap. Intersecting shapes provide a useful zero-distance case.
hierarchyid GetDescendant: Insert Between Siblings
hierarchyid GetDescendant can generate a sibling location before, after or between existing bounds. This read-only example computes paths without inserting records or guaranteeing allocation.







