We can identify the correct employee by their ID attribute, using the @ID' argument: The Projects node has been inserted into the Employee node having ID #2.
We can also insert any collection of nested nodes and values.
Even though there is only one Salaries node, the singleton is still required.
Attempting to run the query without the singleton will result in an error: We see that the node was placed after the only other existing node residing on the same level (the Marketing node) by default.
Let's populate the Accounting node with a new Employee node, which should include node attributes (ID, tier): Going back for a moment to the subject of singletons; if we had used '' as the singleton designation, the new Employee node would have been placed in the bottom Accounting node.
Sometimes, you may also want your query to use values from another, non-XML column, to bring relational and XML data together. The SQL value will be mapped to a corresponding XQuery value and its type will be an XQuery base type that is equivalent to the corresponding SQL type.The position of the insertion is determined by the keywords "into", "following" or "preceding": Replaces the nodes returned by expr with the nodes in expr Single.expr may evaluate to a single element, attribute or text node.If it is an element, expr Single should contain a single element node as well.If it is an attribute or text node, the value of the attribute or the text node is set to the concatenated string values of all nodes in expr Single. Renames the nodes in expr using the string value of the first item in expr Single as the new name of the node.