Home Forums Programming XML Append Xml Node Without Create new IDs. with Same Root. RE: Append Xml Node Without Create new IDs. with Same Root.

  • I think you may need to provide a little more information on what you are trying to do, sample code and what issues/errors that you are seeing. Showing an example xml structure of what you are trying to get to or what is going wrong etc.

    I've had a look at the query itself and it "looks" ok from a syntax point of view.

    Are you trying to insert an xml node into an existing xml node like the following rather than appending it at the bottom of the xml structure?

    DECLARE @xml XML

    SET @xml = '<NewDataSet></NewDataSet>'

    DECLARE @PreviousAddress XML

    SET @PreviousAddress = '<PreviousAddress>asdfadsF</PreviousAddress>'

    SET @xml.modify('insert (sql:variable("@PreviousAddress")) as first into (/NewDataSet)[1]')

    SELECT @xml