Тип ntext устарел, вместо него предлагается nvarchar(max). Если возможно, предпочтительнее изменить тип столбца в таблице. Тогда сравнение с литералом varchar не вызывает затруднений.
Иначе перед сравнением придётся привести значение:
cast([longtext3] as nvarchar(max))
<> '2,048.6'
Также стоит попробовать литерал nvarchar, который решает некоторые похожие проблемы типов:
cast([longtext3] as nvarchar(max))
<> N'2,048.6'
Переведено с английского·Показать оригиналThe ntext type has been deprecated, with nvarchar(max) as its replacement. Changing the table's column type would be the preferable fix, if that's possible. Comparing against a varchar literal then causes no difficulty.
Failing that, you'll need a cast of the value ahead of the comparison:
cast([longtext3] as nvarchar(max))
<> '2,048.6'
Another thing worth trying is an nvarchar literal, which addresses certain related type issues:
cast([longtext3] as nvarchar(max))
<> N'2,048.6'