You have a semi-colon before the "FROM" keyword. Semi-colon is end-of-statement indicator. Also, I think the td.test is not required - you need the STUFF keywordSELECT CASE
WHEN ts_description LIKE '%[' + CHAR(10) + ']%' THEN STUFF (
ts_description,
PATINDEX('%[' + CHAR(10) + ']%', ts_description),
LEN(ts_description),
''
)
ELSE ts_description
END
FROM td.TEST