Use CASE WHEN to check for an open comment sequence and the inability to close the comment sequence and return a column that adds a close comment if necessary.
SELECT * , CASE WHEN CHARINDEX('<!--', description) > 0 AND CHARINDEX('-->', description) = 0 THEN description + '-->' ELSE description END AS clean_description FROM dbo.[table]
Alternatively, if you want to remove the broken comment, use
SUBSTRING(description, 0, CHARINDEX('<!--', description))
for branching the THEN statement.
source share