Update XML variable in SQL Server 2005 with namespace -
i'm trying add new node xml variable containing namespaces using transact sql, there no error, nor variable updated.
here have far:
declare @xml xml; set @xml = '<xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema"> <xs:element name="ecasdata"> <xs:complextype> <xs:all minoccurs="1" maxoccurs="1"> <xs:element id="cmbzona" name="cmbzona" minoccurs="0" maxoccurs="1"> <xs:simpletype> <xs:annotation> <xs:documentation>#zona#</xs:documentation> </xs:annotation> <xs:restriction base="xs:string" /> </xs:simpletype> </xs:element> </xs:all> </xs:complextype> </xs:element> </xs:schema>'; set @xml.modify('insert <xs:test>1</xs:test> (/xs:schema/xs:element[@name="ecasdata"])[0]'); select @xml;
thanks!
i solved it.
into (/xs:schema/xs:element[@name="ecasdata"])[1]');
did magic.
Comments
Post a Comment