Questions tagged [xml]

Short for 'eXtensible Markup Language.' A textual markup language for transferring structured data.

Filter by
Sorted by
Tagged with
1
vote
1answer
44 views

How to get EstimatedRows values from SQL Server execution plan nodes

When I execute the following code in an Azure SQL Database (v12) or SQL Server 2016 instance, I get values in the EstimatedRowsRead column, but not in the EstimatedRows column, and I'm not seeing why. ...
0
votes
1answer
37 views

How to loop through all table rows and perform subquery using values of same row?

I have a table structured as follows: | reference | valA | valB | xml | 1 NULL NULL <xml stuff> 3 NULL NULL <xml stuff> 4 NULL NULL ...
1
vote
0answers
79 views

Converting an XML field to nvarchar causes warning on main SELECT in explain plan

I'm getting a warning on my main SELECT on one field in the explain/execution plan of my query on the following: SELECT ISNULL(CAST(p.loadDiagnostic as nvarchar(4000)),'''') FROM myTable p This ...
1
vote
1answer
16 views

ERROR: invalid XML content, when Select unnest(xpath(… on a text column

I have a text column named big_xml in my table which has the following value: <?xml version=1.0 encoding=UTF-8?> <dpid:DpidDatabase xmlns:dpid=http://ddex.net/xml/dpid/11 xmlns:xsi=http://...
4
votes
2answers
116 views

Search for values in xml data

I have a table of names: Table A John Jim Jason and a table of xml strings: Table B Example 1 <Show Title="" ShowTitle="=False" ShowLine="=False" ShowDescription="=False" ...
0
votes
1answer
46 views

How to Load XML child nodes in to multiple tables

I would like to load the below XML into 2 tables Table 1: Acct Table - it should have the ACCT_NUM and a Key to tie to the Table 2 below Table 2: Should have all the Contacts (1 record per ...
1
vote
1answer
451 views

How to insert very big XML data file to PostgreSQL

I'm using PostgreSQL 9.5 and trying to import XML data file to database. To load the XML I use this function from here CREATE OR REPLACE FUNCTION bytea_import(p_path text, p_result out bytea) as $$ ...
7
votes
3answers
12k views

how to test if XML = '' in sql server?

I am working with sql server 2005 and I had a situation where many values can be passed in a parameter. Based on this: Passing multiple values for one SQL parameter this procedure uses XML as a ...
1
vote
1answer
809 views

How to create a database from an XML file's DTD

I have a fairly large and complex self-describing XML file (It's an Apple Healthkit export; 183 MB). Are there any utilities available to create a database in MySQL or PostgreSQL with the tables ...
1
vote
1answer
606 views

Identifying Execution Plans with Probe Residual

I am trying to find out Execution Plans that has Probe Residual. Need to know the following Which physical and logical operator has this Probe Residual What is the Cost% of that operator in the ...
1
vote
1answer
114 views

SQL Server 2014 - UPSERT XML Multiple rows

We have an input like this <?xml version="1.0" encoding="UTF-8"?> <Orders xmlns:jjsales:api:sales> <Order> <OrderID>334</OrderID> ...
0
votes
0answers
16 views

Postgresql, export to xml, <row> rename

When exporting to xml, I have this output. "<product><table xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""test""> <row> ... </row> <row> ... etc ...
2
votes
2answers
338 views

Empty closing XML tag instead of self-closing tag

My query is USE ... SELECT @JNo=jour_no from WB_PMS..tblJournal WHERE jour_scode=@Jcode IF EXISTS (SELECT 1 FROM WB_PMS..tblArticle WHERE jour_no=@JNo AND art_no=@ArtNo) BEGIN SET @XML= ...
1
vote
0answers
14 views

Connecting a SOAP web service (XML) with a Solr Database

I've stood up a Solr Database in Cloud mode in our Cloudera stack using Cloudera manager and ZooKeeper. I know how to ingest data via pysolr and also through the local browser GUI, but that's usually ...
8
votes
3answers
165 views

XML Query Question

I'm trying to generate a SQL query to get the "DATE" values out of the following SQL XML: I've tried something like this but I don't think I'm understanding the concepts. select xConfig.value('(/...
18
votes
4answers
19k views

FOR XML could not serialize the data because it contains character (0x0000)

I have a big query (if necessary I will post it here) and I'm getting this error: Msg 6841, Level 16, State 1, Line 1 FOR XML could not serialize the data for node 'NoName' because it contains ...
13
votes
2answers
47k views

sp_send_dbmail stored procedure send with attachment

I've been tasked with sending a small monthly report to for one of my customers. The report has previously been run manually on the instance, the output copied to a spreadsheet and send to the ...
0
votes
1answer
151 views

How do I easily create the DDL statements for a schema represented by the contents of an XML file?

I have been given an xml file and it's pretty obvious in looking at the contents that it contains an inherent schema. What I'd like to do is run a program against it that outputs the schema ...
0
votes
1answer
28 views

XQquery for specific attribute of all specific elements in XML

I am, looking for a query to get all attribute values "NetAmount" of Element "PRODUCT" from the following samle XML: <ROOT> <CATEGORY name="A"> <PRODUCT NetAmount="10.50"/> <...
3
votes
1answer
28 views

Why is an empty XML node xml datatype not being recognized in this query?

My query seems to not recognize self-closing or empty nodes at all. Shouldn't the empty <td/> node return 'null'? Or an empty string. Even if I place an empty space in the node, it still is ...
0
votes
1answer
445 views

INSERT/SELECT xml column from one table to another

First off I apologize for asking a question I'm sure is well answered, however I cannot quite understand what I'm reading. I have an existing table with an xml column. I have a second table with the ...
1
vote
3answers
6k views

Oracle Select with xmlquery() error - How to ignore errors?

In trying to extract a subset of data from a Oracle DB table, one of the columns is XMLType, which is extracted with xmlquery() for relevant information. The problem is that the XML data is from an ...
7
votes
2answers
97 views

XQuery doesn't update XML data

I am trying to run the script to update an XML column: UPDATE DataImpTable SET serviceData.modify('replace value of (/SMObjInfo/CentralData/SMData/CentralSDItem/ControlData/text())[1] with "9876"') ...
14
votes
3answers
810 views

Concatenate all values of the same XML element using XPath/XQuery

I have an XML value like this: <R> <I>A</I> <I>B</I> <I>C</I> ... </R> I want to concatenate all I values and return them as a single string: ...
1
vote
0answers
128 views

IBM db2 FOR XML equivalent

I've been trying to Query an item with its sublist all in one go and one way is to use for xml and subquery. I've been using this strategy with sql server and works fine. The relationship is Order ...
3
votes
1answer
60 views

ms sql query multiple table colums as identical tag (sequel)

Extending this original question I am using SQL Server Express 2017 Pretending this is my source table: +-------------+---------------------------+ | ID | Name | Age | HairColor | HasCar | +-----...
0
votes
2answers
45 views

ms sql query multiple table colums as identical tag

I am using SQL Server Express 2017 My Table looks like this +-------------+ | ID | Name | +-------------+ | 1 | Bert | | 2 | Agnes | | 3 | Diane | +-------------+ I'm looking for this kind ...
2
votes
2answers
497 views

specify delimiter in openrowset bulk insert

I'm trying to insert data from CSV files into tables using a cursor and open rowset bulk insert. this works for me 99% of the times but if one of the fields in the csv files contains a comma( , ) the ...
2
votes
1answer
109 views

Can a Selective XML index help when using query()?

Say I have the following SQL query to work with Select myxml.query( ' <go> {for $each in /This/Company/Department[1]/Role/Person return if ($each/Shoes/F[@C="9"]="657493742") then (<ID>{$...
3
votes
1answer
551 views

Create Nested XML in a Sql Server Indexed (Materialized) View

This page https://msdn.microsoft.com/en-us/library/ms188276.aspx indicates that if you wanted nested XML (ie an XML Tree) then you need to setup your query like this: SELECT Col1, Col2, ...
2
votes
1answer
62 views

SSIS:How retrieve and insert an XML Column

I'm trying to Insert two columns from one table onto another. The first column is an int but the second column is an XML. I'm having issues inserting the xml column In first SQL Task I'm doing a ...
4
votes
3answers
5k views

Stored procedure working when run manually, not running in SQL Agent Job

When I execute a Stored Procedure through a SQL Agent Job, I get the following error message: Executed as user: NT AUTHORITY\SYSTEM. XML parsing: line 10, character 33, unexpected end of input ...
3
votes
1answer
152 views

T-SQL LIKE Predicate failed to match with whitespace in XML converted varchar

Recently I attempt to search for a particular pattern by converting XML data into varchar(max) although I'm aware it's not the best practice and found out it's not working as expected:- Setup ...
0
votes
1answer
562 views

Convert ASCII Bytes from XML to VARCHAR

I have XML data which includes strings as byte array, which I'd like to convert to VARCHAR in SQL Server 2012. Example snippet with text="2Hallo" and the code I tried: DECLARE @testxml XML = N' <...
2
votes
2answers
40 views

How can I position the element generated by XMLTEXT in a FOR XML query?

I'm trying to use FOR XML to simulate an OData feed. One of the requirements I have is that somewhere I need an XML element which is constant for all records; I was planning to use the XMLTEXT ...
1
vote
0answers
15 views

PostgreSQL FTS for quoted xml tags - is it possible?

I use Pg FTS to text-search database containing some technical descriptions/comments. Which in particular happen to contain XML snippets. Those are amazingly difficult to find by XML tags. I found ...
0
votes
0answers
255 views

Easiest way to update XML inside of a SQL table column?

I have an SQL DB, Directory. It contains a table, dbo.User. Within that table there is a column, Info. The Info column contains ~1000 lines of xml tags. Well I want to modify only one of those tags, ...
0
votes
1answer
43 views

Where clause in a XML column

I have the following XML column in my Oracle 11 G DB: <?xml version="1.0" encoding="UTF-8"?> <l-analysis version="2.9"> <vehicle> <odo-reading latest="true"> ...
6
votes
1answer
740 views

How to split XML array into separate rows (while upholding consistency)

I am working on the database dump of this exact stack exchange section. While I am working on it I have encountered one issue that I am currently unable to solve. In the XML File Posts.xml the ...
2
votes
2answers
410 views

Help with FOR XML EXPLICIT query

I have an audit table constructed (basically) as follows: CREATE TABLE [dbo].[AUDIT]( [UNIQUE_ID] [int] IDENTITY(1,1) NOT NULL, [TABLE_NAME] [nvarchar](50) NOT NULL, [TABLE_UNIQUE_ID] [int] NOT NULL, ...
0
votes
0answers
59 views

Stored procedure or Table Function doesn't return value when parsing XML

Script to create table and function at the bottom of the post: We have lately ran into problem that sometimes our stored procedures or Multi-statement table value that include sql statement parsing ...
1
vote
1answer
122 views

Microsoft Optimal method for columns into 1 word: XML Raw or Concat

What is fastest, performance method to make columns into one word? Does Microsoft have recommendation, or is there performance Big-O studies on FOR XML RAW vs Concat? Company has multiple tables with ...
15
votes
3answers
1k views

SQL server changes XML structure when inserted

I'm inserting some XML data to an XML column in SQL server but after the data has been inserted it has been changed by sql server. Here is the data I insert <xsl:value-of select="...
2
votes
1answer
949 views

Generate DDL Statement from XSD file

I have a database schema exported into XML format. My goal is to create a DDL statement from the XSD files that I can use to import the data into a different platform without manually having to ...
1
vote
1answer
28 views

Update badly formed XML to allow parsing

I have inherited a production system that needs some fine tuning to enable easy extract of the result set. A record gets added to a table which contains an XML field, with contents similar to the ...
7
votes
3answers
45k views

SQL Row concatenation with XML PATH and STUFF giving aggregate sql error

I am trying to query two tables and get results like the following: Section Names shoes AccountName1, AccountName2, AccountName3 books AccountName1 The tables are: CREATE TABLE dbo....
3
votes
3answers
1k views

Why is XML taking up more storage than VARCHAR(MAX)?

We have large tables storing XML data as varchar(MAX). The data is for reference/historical purposes, it's not queried. Based on what I've read, storing as XML datatype instead of VARCHAR(MAX) should ...
3
votes
2answers
202 views

XML/SQL Server 2008 Error: XQuery…Cannot implicitly atomize or apply 'fn:data()' to complex content elements

Update 10/30/2018. Just in case anyone is interested, I have started to document at the end of this post what I'm actually doing to solve this, just because I've found some interesting things. ...
1
vote
2answers
5k views

Improve performance of converting a large xml file (~300 MB) to relational table in SQL Server

So this is what I have so far: --Read xml content into a XML data type variable DECLARE @FileData XML SELECT @FileData = CONVERT(XML, BulkColumn) FROM OPENROWSET(BULK '\\file_path\test.xml', ...
4
votes
1answer
377 views

Using CoreData on a client-side application

This may be a bit more of an SO question, but... If I'm writing a client-side application for OS X that's going to sync with an online MySQL database, is there any difference on if I have CD use ...