I would like to see how many times the field MSGTEXT
is repeated in the table MMOUTBOUND
. For that I use the following query:
SELECT
MSGTEXT,
COUNT(*) TotalCount
FROM MMOUTBOUND
GROUP BY MSGTEXT
HAVING COUNT(*)>1;
But I get an error because ntext data types cannot be compared or sorted. How can I achieve this for the ntext data type?