I have some weird requirements that demand a specific XML format. Due to short deadlines and my lack of skills I decided to do a fast solution where I generate the XML through string concatenation. and this gives the output which I need. However, I’ve been told numerous times that this is not best practice, and creating XMLs through string
Tag: xml
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
Exclude blank columns from XML
I am trying to get Table Rows to XMLs. I am able to do it in the following way and the only issue I have is that it also generates XML tags for blank columns. create table test_niks_01(x int, y …
WHILE / LOOP inside CASE expression SQL – ORACLE
I am testing a select statement containing a CASE expression and I need to add a WHILE / LOOP inside one of the WHEN conditions. The logic from this statement will eventually be included inside a PL/…
Add child note above node
Am trying to get from SQL to XML however have to format this correctly or it will not work. I am using C# to insert my sql between the QBXML This is what I get This is what I need ”’ ”’ I am not sure how to add the “CustomerAddRq” over each “CustomerAdd” Answer Try xml linq. I took
FOR XML in SQL Server: Elements based on common values of columns
I’m using FOR XML to create an XML file out of SQL queries. I want to have elements based around common values for a particular column, in this case “location”: I can easily convert his into XML row-by-row like so: Which produces XML that looks liks this: But what I actually want is this: Answer You can use an ad
SQL – FOR XML – How to add property to tag
I have the a stored procedure to generate an XML document based on the UBL-TR-2.1 standard. This is the query where the xml data is generated: A sample output of this query is this XML file: This works so far so good. But now some XML elements shall have attribute in the element itself. One example is: How can I
Extracting values from XML column in Oracle
I have some data in an Oracle table which is stored in an XML-format string (column response in table WS_LOG). I would like to extract data from each different node below
XML load is slow. Using text() when reading XML file with attribute-centric mapping
I am reading in an XML file into the database. It works fine however it is very slow. I was wondering if I can use text() in order to speed the process up similarly to the solution in this post: Xml …
How do I get a value from XML column in SQL?
So, I have a table with a large chunk of data stored in XML. The partial XML schema (down to where I need) looks like this: