Home All Groups Group Topic Archive Search About

Duplicate Text data

Author
18 Jan 2005 2:21 PM
coromokes
Anyone have a method for identifiying dupes in a text field?

Author
18 Jan 2005 4:34 PM
David Gugick
coromokes wrote:
> Anyone have a method for identifiying dupes in a text field?

By dupes, you mean the existence of the same text value in more than one
row? If so, you can group on the text column and use a having clause to
test for dupes.

You'll need to convert to a varchar or nvarchar data type first, which
means you'll only get access to teh first 4,000 or 8,0000 characters for
the test. But maybe that's good enough.

Select CAST(TextDataCol as VARCHAR(8000))
From TableName
Group By CAST(TextDataCol as VARCHAR(8000))
Having COUNT(*) > 1

--
David Gugick
Imceda Software
www.imceda.com

AddThis Social Bookmark Button