How to get the numeric part from a string using T-SQL?

select left(@str, patindex('%[^0-9]%', @str+'.') - 1)

Leave a Comment