How do I
Take:
RJI#\\\\\\\\Cjserver\\TrialWorks\\CaseFiles\\10000269\\Pleadings\\RJI - 10005781.doc
Find Constant expression \'\\\\Cjse
DECLARE @input NVarChar(1000) =
'RJI#\\Cjserver\TrialWorks\CaseFiles\10000269\Pleadings\RJI - 10005781.doc',
@match NVarChar(100) =
'\\Cjserver';
DECLARE @position Int = CHARINDEX(@match, @input);
SELECT SUBSTRING(@input, @position, 1000);
I'm just using 1000 for some arbitrarily large value. You should probably size this more appropriately to your data.