What is the correct way to get the last word of a part of a varchar?
DECLARE @desc varchar(100) SET @desc=\'EXCHANGEUNIT P1i / SILVERBLACK/ CYRILLIC\' SELEC
Use a combination of REVERSE, LEFT and CHARINDEX - like so:
DECLARE @desc varchar(100) SET @desc='EXCHANGEUNIT P1i / SILVERBLACK/ CYRILLIC' SET @subdesc=RTRIM(LEFT(@desc, CHARINDEX('/', @desc) - 1)) SELECT REVERSE( LEFT( REVERSE(@subdesc), CHARINDEX(' ', REVERSE(@subdesc))-1 ) )