none
The data types xml and varchar are incompatible in the equal to operator.

    Question

  •  

    Thanks in advance
    i am trying to update a table which contains xml type data field
    my query is as follows

    Update ProductBase
    set CrossSell.modify('
    ')
    where CrossSell = 'NULL'
    i dont have any idea about what should be the value inside set CrossSell.modify(   )

    the CrossSell field contains null value now


    i am trying to update the ProductBase table which contains CrossSell dtafield (xml type) with an inserted value which gets from clr trigger using xmlwriter

    please help

    Wednesday, October 08, 2008 6:23 PM

All replies

  • Try this:

     

    Code Snippet

    UPDATE ProductBase

    SET CrossSell.modify(' ')

    WHERE CrossSell IS NULL

     

     

    Use IS NULL otherwise SQL tries to evaluate the xml column CrossSell as a character.

     

    Hope this helps.

     

    Wednesday, October 08, 2008 8:53 PM
  • still iam getting error as ''Incorrect syntax near the keyword 'IS'

    thanks for your quick response

    Wednesday, October 08, 2008 9:49 PM
  •  sql beginner wrote:

     

    Thanks in advance
    i am trying to update a table which contains xml type data field
    my query is as follows

    Update ProductBase
    set CrossSell.modify('
    ')
    where CrossSell = 'NULL'
    i dont have any idea about what should be the value inside set CrossSell.modify(   )

    the CrossSell field contains null value now


    i am trying to update the ProductBase table which contains CrossSell dtafield (xml type) with an inserted value which gets from clr trigger using xmlwriter

    please help

    Monday, October 13, 2008 6:44 PM