The xml data type cannot be compared or sorted, except when using the IS NULL operator.

Hi,

I have a 3 tables and get the values using RIGHT OUTER JOIN for my requirements.

I can get the correct value as what i need. But values are coming with duplication. So avoid duplication i will put group by for two columns that datatype is xml. I got the below error when i select the query. I already saw the solution in this forum. But it is not working for me. I got the same problem. Hope you understand my problem.

Msg 305, Level 16, State 1, Line 2
The xml data type cannot be compared or sorted, except when using the IS NULL operator.

Regards
Guvera
LVL 8
guveraAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
you might though want to read this article to check for alternatives for the GROUP BY, which might also be more efficient:
http://www.experts-exchange.com/A_3203.html
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
this should do it:

group by CAST(your_xml_field as VARCHAR(MAX))
0
 
guveraAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.