• Interesting idea, I hadn't thought about reversing the string when doing this before, thanks for posting it. A couple of comments:

    1. The declaration for @samplestring is included twice in your example.

    2. This will only work as intended if the delimiters between which you're searching aren't duplicated (e.g. If the sample string was '###This is a sample string####...' the value returned would be "##This is a sample string###".

    3. I find that using charindex and determining the length of the delimiters rather than including hard coded numbers can save more time when parsing strings this way. Example below:

    declare @s-2 varchar(max)

    declare @1 varchar(max)

    set @s-2= ([Select Statement goes here])

    set @1 = (select substring(@s,charindex('[1st delimiter]',@s)+len('[1st delimiter]'),charindex('[2nd delimiter]',@s)-charindex('[1st delimiter]',@s)-len('[1st delimiter]')))