Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
SELECT Col1, STUFF(LTRIM(Col1),PATINDEX('%[^0-9]%',LTRIM(Col1)),LEN(Col1),'') AS Col2, REVERSE(STUFF(REVERSE(RTRIM(Col1)),PATINDEX('%[^0-9]%',REVERSE(RTRIM(Col1))),LEN(Col1),'')) AS Col3FROM Table1