• Am I over complicating the string extraction? I want the text between the first and second occurrences of '.'

    DECLARE @paths TABLE(path varchar(50))

    INSERT INTO @paths

    SELECT '.ab.qwer.poi' UNION

    SELECT '.1.qwerty.ab' UNION

    SELECT '.1234567890.asd.a'

    SELECT

    path,

    LEFT

    (

    RIGHT

    (

    path,LEN(path)-1

    )

    ,

    charindex('.',RIGHT(path,LEN(path)-2)

    )

    ) AS Member

    FROM @paths