I have data like this:
string 1: 003Preliminary Examination Plan string 2: Coordination005 string 3: Balance1000sheet
The output I exp
declare @puvodni nvarchar(20) set @puvodni = N'abc1d8e8ttr987avc' WHILE PATINDEX('%[^0-9]%', @puvodni) > 0 SET @puvodni = REPLACE(@puvodni, SUBSTRING(@puvodni, PATINDEX('%[^0-9]%', @puvodni), 1), '' ) SELECT @puvodni