In a table, I have a column called MEMO_TEXT that is a text data type. When I try creating a view and use a GROUP BY, I get the following error:
SQL Server Database Error: The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
I get this error when I try to do a DISTINCT on the query as well. Any ideas on how to get around this?
If you need any more information, please let me know.
One hack around it is to cast it as an
nvarchar(max).This is a documented way to increase the string length beyond 4,000:
A similar trick applies to varchar().