It's not completely clear what you mean. I assume that you have two rows here? As in:
1 20017546 FFRT-TR= 3456 TT:SX
2 2398 FFRT-TR=6532
Please give some DDL like this when you post:
CREATE TABLE SPHelp ( RowID INT , Rowvalue VARCHAR(200) ) GO INSERT dbo.SPHelp ( RowID , Rowvalue ) VALUES (1, '20017546 FFRT-TR= 3456 TT:SX') , (2, ' 2398 FFRT-TR=6532')
If this is the case, then you can use CHARINDEX to find the location of your FFRT. For example, if I wrote
SELECT CHARINDEX('FFRT-TR=', sh.Rowvalue) FROM dbo.SPHelp AS sh;
I'd get 10 and 7. Those are the character location where that string starts. If I then combine that with SUBSTRING, I could do:
SELECT SUBSTRING(sh.Rowvalue, 1, CHARINDEX('FFRT-TR=', sh.Rowvalue) - 1)
FROM dbo.SPHelp AS sh;
This gives me just the first part of the string.
18 People are following this question.