Questions tagged [xml-dml]

The XML Data Modification Language (XML DML) used Microsoft SQL Server 2005 and above to manipulate data in an XML field.

XML Data Modification Language (XML DML) is an extension of the XQuery language. XML-DML keywords include - insert - delete - replace value of

XML DML is similar to Oracle XU (XQuery Update).

63 questions
0
votes
1 answer

SQL Server - xml type columns - XML DML

I want to delete some nodes from menu xml that is being stored in a typed xml column in database. Snippet from menu xml - role1
inutan
  • 10,558
  • 27
  • 84
  • 126
0
votes
1 answer

Delete a node and Update value of an element in subsequent nodes

I have the following XML. I need to delete an entire node with Object Name = SubType111 depending upon the variable TestID Then I need to update the sequence field of all the subsequent nodes, subtract by 1 I am able to get the First Part right, but…
vbgp
  • 73
  • 7
0
votes
1 answer

How can I replace an XML substring with the results of a query in SQL Server?

I have an XML column in SQL Server that contains a SQL where clause. I would like to replace specific substrings with the results of a query. In the example below, I want to replace p.[EconPeriodID] = 4 with EconPeriod = 'Jan 2011' and replace…
Joel MC
  • 107
  • 2
  • 7
0
votes
1 answer

Changing xml node value in SQL with xquery [SQL Server]

I have example XML in one of the table column: c d b How can I replace value of A node into something like that: e f
rysiard
  • 77
  • 1
  • 1
  • 7
0
votes
1 answer

How to update xml field in SQL Server

I have a XML column called xmlValue in a SQL Server table tbl1 with datatype nvarchar(max). The xml value in this column looks like this:
abc
user8530455
0
votes
1 answer

How to insert dynamic node in xml? sql server

I have a table A. I want to insert column into xml. I know '@x.modify('insert {sql:column("XColumn")}' into /') from A' is ok. But how to insert dynamic node in xml? '@x.modify('insert <{sql:column("XColumn")}>1'…
Nye.JN
  • 27
  • 4
0
votes
2 answers

Insert multiple grouped xml documents into a single xml document with SQL

I have two tables tmpEntityAddress EntityId Address ________ _______ 5
5
7
tmpEntityAddresses EntityId XML ________ _______ 5 5 I…
Technicolour
  • 677
  • 1
  • 7
  • 17
0
votes
1 answer

How to exclude more than one node, so one of those exclude will rearrange its attributes using XML DML?

this is a reference from this posted question, as I am looking to rearrange the value of attribute inside nodes , so the first node of will have 10, then the second node will have 20 and so…
Antonio
  • 87
  • 8
0
votes
2 answers

XML DML query for attribute

declare @myDoc xml set @myDoc = '
markkidduk
  • 13
  • 7
0
votes
1 answer

Moving nodes in XML and rename them using XML DML

Given the following XML all nodes named IsEurozone have to be renamed to HasFxrEuro. 1 Macro Scenario 1
MiGro
  • 471
  • 1
  • 4
  • 17
0
votes
1 answer

Using SQL Server xml.modify on an xm document with escaped xml

I want to make modifications to an XML document using SQL Server's XML.modify. My problem is my XML document uses some escaped XML so "<" are appearing as "<" and ">" is appearing as ">". I want to know if it would be possible to set the value of an…
0
votes
1 answer

XMLdata.modify Condition

I'm usint MS SQL and in XML field need update like this. UPDATE Table SET IF (XMLdata.exist('/ns:root/Field/text()') = 0) XMLdata.modify(' insert text{"New value"} into (/ns:root/Field)[1] ') ELSE …
0
votes
1 answer

XML DML (modify) in SQL Server Agent Job

I'm trying to modify an XML value using XML.modify in an SQL Server Agent job. I'm using SQL Server 2008. Here is my code... DECLARE @temp XML; DECLARE @newname VARCHAR(50); SELECT @temp = CAST(ExtensionSettings AS XML) FROM…
kgmoney
  • 33
  • 4
0
votes
1 answer

can't insert xml dml expression as a string

Here is the code below that would explain you the problem... I create a table below with an xml column and declare a variable, initialize it and Insert the Value into the xml column, create table CustomerInfo (XmlConfigInfo xml) declare @StrTemp…
81967
  • 115
  • 2
  • 9
0
votes
3 answers

How to insert xml node in Sql Server without inserting empty namespace?

This is an example of how my source xml looks Document Title 1
Jason L.
  • 1,125
  • 11
  • 19