Link to home
Start Free TrialLog in
Avatar of cuconsortium
cuconsortiumFlag for United States of America

asked on

T-SQL: Remove Duplicates in Select statements with ntext data type

Hi experts,

  I'm writing a select statments witht ntext data type field.  This select statment requires a Union operator.  Since Sql Server 2005 gave me an error "The ntext data type cannot be selected as DISTINCT because it is not comparable", I have to change Union to Union All.  When Union All is used, the statment works without error.  However, it returns duplicate rows.  

  How do I eliminate these the duplicated rows from the select statment?


Thank you!!!  
ASKER CERTIFIED SOLUTION
Avatar of cmgarnett
cmgarnett
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cuconsortium

ASKER

It works! Great!
Or batter yet, cast (mycolumn as nvarchar(max)), which has no such limitations