Below is my query. It is giving me correct output but I need to run it efficiently as it is used for 500k records.
DECLARE @DESC_MESSAGE VARCHAR(5000)
SET @DESC_MESSAGE = '12345 VENKAT was entered ODC ABCD-3'
I would be inclined to use
select stuff(col, 1, chardindex('was ', col + 'was ') + 4, '')
+ 'was + in the
charindex() function just guarantees no error if
'was ' is not in the text.