Use BASE64_ENCODE in SQL Server 2025, decode binary and text safely, compare URL-safe output, and replace older XML encoding expressions.
Parsing File Name Dates to Find the Newest Backup With REGEXP_SUBSTR
A restore script that sorts names as text can grab a copy or a log file. Parse the dates first, drop the bad ones, and break ties on purpose.
Trigram Matching: Finding Similar Words With an N-Gram Table
Build trigram matching with GENERATE_SERIES and an indexed n-gram table, rank shared pieces, and compare spelling similarity with SOUNDEX.
Overlapping Chunks: Splitting Long Text With GENERATE_SERIES
Split long text into overlapping pieces with one short query. Plus the quiet traps: NULL text, a step that is too big, and chopped words.
Escaping Wildcards in LIKE: Searching for % and _ Literally
Handle escaping wildcards in SQL Server LIKE searches with brackets, ESCAPE, and a reusable function that preserves literal input.
A Crossword Helper in T-SQL: Matching Word Patterns With LIKE
Match word patterns with LIKE and SUBSTRING, build sorted-letter anagram signatures, and use a leading-letter index for crossword searches.
LEN vs DATALENGTH: Trailing Spaces, Unicode Bytes and NULL
Compare LEN vs DATALENGTH for trailing spaces, Unicode, UTF-8, NULL, and MAX values before safely resizing SQL Server string columns.







