I have a table in a SQL Server 2000 database that has these columns:
id: Primary Key, bigint, auto incrementCustomerID: Foreign Key, intReceived_Time: bigint (epoch time of received report)XML_Report: ntext (raw XML file. Typically ~100kb but some reports are >100MB in size)
There are about 750K rows and the table is about 50GB in size.
I have found that there are some duplicate reports where the XML_Report
values are exactly the same. I am trying to get a gauge as to how many duplicates there are with the following query:
SELECT [XML_Report], COUNT(*) FROM [Reports] GROUP BY [XML_Report]
but SQL Server returns:
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
Is there any way to get a count of duplicate reports?