• If the format is always 3 char followed by 5 numeric can you just get the right 5 characters?

    DECLARE @tbSample TABLE(Code VARCHAR(10))

    INSERT INTO @tbSample SELECT 'SDH00151'

    INSERT INTO @tbSample SELECT 'SDH00152'

    INSERT INTO @tbSample SELECT 'SDH00153'

    SELECT

    Code

    ,RIGHT(Code,5) AS CodeNum

    FROM

    @tbSample