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

  • declare @CrossSell XML

    update dbo.ProductBase

    set CrossSell.modify('insert into (/CrossSell)[4a321938-c189-453c-9e8d-850a2885453f]')

    where CrossSell = @CrossSell

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

    pls help

  • Well, the error means exactly what it says...you can't compare the XML data type like that. I see that you declare the XML variable, but never assign it a value, what are you trying to do? Are you checking for NULL, or did you not post all of the code?

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • Please don't cross post.

    Continue discussion HERE:

    http://www.sqlservercentral.com/Forums/Topic582804-149-1.aspx

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • i have to update CrossSell field of productbase table ,the CrossSell field is a xml data type which contains null value

    i inserted values in a different table using clr trigger in visual studio 2008,and i changed inserted value to sting using xml writer ,now i need to update the productbase table's CrossSell field using that value when iam trying to do that by this query

    Update dbo.ProductBase

    set @CrossSell= ('

    ')

    where CrossSell='Null'

    i got an error The data types xml and varchar are incompatible in the equal to operator.

    so i tried in different ways ,i am new to xml data type so if u guys have any idea please help

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply