Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 9 months ago. Improve this question I studied the concept of XPath and xml but did not understand how they relate to what XPath is designed to do as a query
Tag: xquery
How to delete more than one node with xml-query
with this code, I can remove one node (field_without_interest) of this xml element. But I would like to remove two nodes now( field_without_interest and PERSON_NUMBER). I have tried to place the for loop at differents places (You can see that in code. But I don’t think it useful to for to write every attemps in stackoverflow) but to no avail.
Filter an XML column in SQL Server
I have an xml type column productsXML in product table I want to find all the rows that have <products></products>. I tried this: This is returning all the rows that have products tag and understandably so. Is there a way to filter only those rows that have <products></products>? Answer PLease try the following solution. It is checking that the root
How to extract attribute value from XML in SQL Server 2019 (v15)?
I would need to extract elements from this XML into a tabular form, but I can’t seem to get my head around how this would work on SQL Server via something like XQuery. I have all the data in a temporary table called “#1” and the XML itself lies in a field called “Message” in that temporary table. How can
Xquery Get Consecutive Distinct Values
Trying to get consecutive distinct from the following XML. Expected Result : Current Result : Code : The distinct-values get distinct from the whole set, but I would like to get distinct values only if there are consecutive. Answer We have a pure XQuery solution. SQL Output
SQL – Cast Column as XML then Query Value from said column
I have a column with a bunch of unformatted XML code. I am trying to really just query 1 value out of the column. The value inside of the column is listed below: The value that I am looking for is displayValue=”NSharePoint Read Item” which is located in the line: I have the following query: which I have been using
XQUERY -SQL Retrieve list of child and parent ID
How I can query the xml in order to obtain the following result? I am completely new on using XQuery. XML sample: And the result: idAsig B1_1 B1_2 B1_3 B1_4 B1_5 1 NULL NULL NULL NULL NULL 2 1 0 N 8 4848 2 52 0 N 8 625 3 1 0 N 8 589 3 39 0 N 8
Unable to Query XML Document with SQL/OPENXML
I would like to query the following XML-File using SQL: Using this code I would like to get the value for “mRID”: However, the result is: mRID NULL How to get the correct value for mRID (‘2f6f8b82348440b1b121bca06311945d’) instead of NULL? Answer Microsoft proprietary OPENXML and its companions sp_xml_preparedocument and sp_xml_removedocument are kept just for backward compatibility with the obsolete SQL
Numbering sequences from xml according element’s values
The PointNum attribute means the number of coordinates in the chain. The coordinate chain starts at 1 and ends at 1 as well (inside each Parcel element). However, within the sequences of these points, …
SQL: Delete XML node in an UPDATE statement
I keep getting this error: In search of a solution to this answer I came across this SO article about updating in a SELECT statement: How do I UPDATE from a SELECT in SQL Server? Example… Note: the field CustomProperties is nvarchar(max) which I convert to xml. I also tried a cursor (nasty things), but getting the same error. Is