Home Forums SQL Server 2005 T-SQL (SS2K5) TSql XML Column modification error with XSD using replace value of RE: TSql XML Column modification error with XSD using replace value of

  • Thanks to Mikael Erikssen that replied to me on stack overflow forum.

    A solution to this issue is to remove the restriction on my Boolean attribute and probably more important only use true() or false() function to test or set the attribute as follow:

    -- XSD :

    <xs:attribute type="xs:boolean" name="Deleted" use="required" />

    -- Update

    UPDATE @XmlTest

    SET MyContent.modify('replace value of (/Root/MyNode[@Code="AAA" and @Deleted=false()]/@Deleted)[1] with true()')

    WHERE ID = 1