A column holds alphanumeric values that start with a number, and ORDER BY sorts them as text. Here is how to sort the rows by the Numeric part instead.
SQL SERVER – Find First Non-Numeric Character from String
No built-in function finds the first non-numeric character in a string, so I use PATINDEX. Here is a quick script with sample data you can try.
Cleaning Address Data in T-SQL: Trimming, Casing and Standardizing
Start cleaning address data with preserved originals, normalized spaces, careful casing, street-word mappings, and postal-code review flags.
Why CAST to a Short VARCHAR Returns a Star Instead of an Error
Understand why a short VARCHAR returns a star for an integer, compare Unicode errors and string truncation, and size conversions safely.
REGEXP_COUNT in SQL Server 2025: Counting Pattern Matches in Text
REGEXP_COUNT counts how many times a pattern matches inside a text value, a job that used to need LEN and REPLACE tricks. This post tests it on SQL Server 2025: start position, flags, NULL and empty text, a data quality check, and where the old trick still fits.
PARSENAME for Dotted Values: Build Numbers and Object Names
Why does revision 12 sort before 7? Because the parts are text. Here is how PARSENAME fixes it, and where it trips you up.
Second-Order SQL Injection: When Stored Data Becomes Code
A safe insert does not make the saved value safe forever. Here is how stored text turns into code later, and the plain fix.






