SUBSTRING boundaries distinguish start zero, start one and positions past the end. Read empty strings, shortened counts and typed NULL results.
STR: Check Width and Reduced Decimal Places
STR can reduce decimal places when its requested width cannot hold the complete fractional display. I inspect the complete text, including spaces and signs. A populated result does not guarantee that the number remains visible.
Recursive CTE Cycles: Detect Loops and Depth Boundaries
Recursive CTE cycles need evidence of the repeated relationship. Use a visited path and separate cycle flags from deliberate depth boundaries.
Generating Backup Commands for Every Database With STRING_AGG
Use STRING_AGG for generating backup commands with copy-only backups, checksums, safe database names, and dated files for careful review.
Splitting a URL Into Host, Path and Query String in T-SQL
Practice splitting a URL into host, path, and query values with T-SQL string functions, SQL Server 2025 regex, and ordered parameter rows.
STRING_AGG Order: Keep NULLs and Type Width Visible
STRING_AGG order belongs inside WITHIN GROUP. This example preserves duplicate labels, shows how NULL differs from empty text and casts to nvarchar(max) before aggregation.
STRING_ESCAPE JSON Text: Escaping Is Not Serialization
STRING_ESCAPE JSON text is still text that belongs inside a JSON string. This example compares quotations, backslashes and a newline with complete FOR JSON PATH objects.







