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
570 views

sql server query execution plan via jdbc driver

is there a way to fetch the XML generated by the "Actual Execution Plan" in SQL server 2012 - 2014, but via JDBC driver for Java -- sqljdbc_6.0.8112.100_enu? (preferable forward compatible with 2016) ...
0
votes
1answer
42 views

MAX Query returns set results when using dbmail

I am setting up alerts in a system and I want to query a db table and get the max date passed in to a data row and only that one entry. For some reason, when I do it, the HTML email that comes ...
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>{$...
1
vote
1answer
54 views

Compare value from xml node that contains decimal

I need to compare the values of two different XML nodes for a record stored on SQL Server 2014. Here is the contents of my XML column that I will be using: <Document> <PolicyId>0</...
1
vote
1answer
692 views

Performance of XML to Table Function in Stored Procedures

In a number of the databases I'm helping to maintain, there is a pattern where the code passes in a list of IDs as an XML string to a stored procedure. A user-defined function turns them into a table ...
0
votes
3answers
2k views

Dynamic conversion of long data to wide with multiple columns

I'm trying to convert long data: ID|SchoolID|Section|RepScore|SportsScore|PartyScore 1 |20 |1 |23.2 |70.2 |42.3 2 |20 |6 |65.2 |75.8 |52.3 ...
0
votes
1answer
41 views

Special letter behaviour problem?

I asked question in very blurry manner because I cannot explain in short sentence what is my problem about. In general I have a set of procedures which transforms text and XML. Inside the procedures ...
8
votes
1answer
4k views

How to return a null from an empty XML tag in SQL server using Xpath only?

I have an application that stores various user defined data points about a record in an XML column. I have no control over how these are stored or updated. When I query a column it can return 1 of 3 ...
2
votes
1answer
3k views

Merge two XML outputs to one from SQL query

I have following code developing 2 XML files but I would like them to be in one file itself with multiple Organization tag. SELECT LTRIM(RTRIM(c1.cptname)) as "orgHeader/orgCode", LTRIM(RTRIM(c1....
2
votes
1answer
7k views

How to create XML file by SQL query?

I have to create an XML File using sql <externalCodes> <externalCode> <system>CALYPSO</system> <extCode>cptname</extCode> </externalCode> <...
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 ...
0
votes
1answer
35 views

Help with reading xml [closed]

I am struggling to extract data from an XML file. The file for all intense and purposes looks like this: <Message> <Code>Hello </Code> <Code>bye </Code> </Message&...
0
votes
1answer
893 views

Extracting specific XML data from SQL Server column

I have XML documents in a SQL Server column. I need to extract a datetime field from this column but the below code isn't working (If I comment out that line everything else works for me) and I was ...
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> ...
2
votes
1answer
3k views

How to convert an XML deadlock file into a graph or something readable?

I'm looking for a easy or manageable way to read an XML file, specifically the XML output for SQL Server deadlocks. I have some servers that are not being monitored for various reasons. I found the ...
5
votes
1answer
730 views

What is the most effective SELECTIVE XML index?

I am trying to determine the most effective selective XML index for an XML column within a table of 100 million rows. My question is similar to : Sql Server 2012 Extended Events for Selective Xml ...
3
votes
1answer
335 views

TSQL (2014) - Importing XML with accented and punctuation Characters

Using this solution from Forrest: DECLARE @XML xml = '<?xml version="1.0" encoding="UTF-8"?> <Orders> <Order> <OrderID>334</OrderID> <...
-4
votes
1answer
2k views

How can I get a comma seperated value from XML to insert into the table in sql server [closed]

How can I get a comma separated value from XML to insert into the table in sql server . Input: declare @xml xml=' <REQUEST> <HEADER> <TRAN_ID>101</TRAN_ID> <...
6
votes
2answers
571 views

Why high compile times for functions with XML on SQL Server 2016?

We have inline functions which gather up data into XML, pass that derived XML to other functions, which then shred it and reform it as a string. (Your "you shouldn't do that sort of stuff in T-SQL" ...
5
votes
3answers
5k views

T-SQL dynamically import XML into tables (SQL Server 2014)

I have a XML response with this structure but with some 150 different nodes: <?xml version="1.0" encoding="UTF-8"?> <Orders> <Order> <OrderID>334</OrderID> ...
1
vote
1answer
84 views

Invalid characters in xml [closed]

I have just downloaded a large xml file and most of characters appear as "�". I changed the encoding but there was no improvement. Anyone knows what this might be due to? One fishy thing: the file ...
2
votes
1answer
964 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
2answers
224 views

Coding Problem - Do I Use Pivot, XML, or Something Else

I'm having a brain-not-working moment and could really use some help. This is SQL Server 2014 Standard ed. I have 3 Tables - for simplicity, we'll call them "name", "address", and "international". ...
2
votes
2answers
1k views

Distinct XML values mysql

I have a problem parsing XML input. I get a string of all Authors while I only want the distinct author or first value. +----------+--------------------------------------------------------------------...
1
vote
0answers
50 views

Finding and replacing non-specific text to lowercase variant

I've been cracking my brain on a problem that I had at work. In one of my tables is a bunch of rows, with a certain column that contains XML data that has several properties like this: (simplified) &...
2
votes
1answer
23k views

Read inside node value of Xml using Sql Server

I want to read node values of xml in sql, my xml look like this I just want to read value of order node that is 'Order 1' and my code is EXEC sp_xml_preparedocument @idoc OUTPUT, @doc SELECT * FROM ...
4
votes
3answers
340 views

Column with selective aliases

I want to select an alias based on specific column criteria and output the required XML. Say we have a table named ACCOUNTS: Name Age --------- --- John Doe 30 Mary Lane 40 Alice Bob 50 ...
1
vote
0answers
452 views

Convert XML data into table in mysql

I have a XML data like this <Root> <Data> <Heading>Time Management</Heading> <Field> <Description>Prioritizing work</Description> <...
0
votes
2answers
87 views

Using Structured Filetypes as Databases

In having a debate with a coworker it was posed that a flat file, in this case a CSV, could be considered a database. This would include XML and JSON as well. I'm interested in differing views on this....
1
vote
1answer
196 views

Update XML metadata in SQL Server

I'm trying to change the value in the XML metadata using SQL Server. The XML file looks like this: <Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/...
-2
votes
2answers
330 views

Extract hierarchical data from XML

I have a table: CREATE TABLE [Course].[Navigation]( [NavigationId] [int] IDENTITY(1,1) NOT NULL, ParentID int, ChildID int, [Type] [varchar](100) NULL, [Label] [int] NULL, [...
0
votes
0answers
51 views

xml to relational data for the lazy

I am sitting with lots of data in multiple xml files, which I would like to convert to relational data, for better being able to analyze it. Are there any tools that can transform the data / import to ...
1
vote
1answer
815 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 ...
4
votes
1answer
3k views

Querying XML nested nodes

I need to integrate a daily XML file into my system. The XML file has an schema similar to this: create table txml(id int identity, data xml); insert into txml (data) values (' <order> <...
0
votes
1answer
65 views

XML input data query

I'm looking at a stored procedure that takes some XML from a web app and creates a SQL search with it. There are 11 variables but the execution plan says that this one line takes 68% of the whole ...
1
vote
2answers
4k views

Extract data from an xml fragment

In SQL Server 2014, I have the following xml fragment : <salesorder> <ordnum>123</ordnum> <orddate>2017-04-17</orddate> <details> <detail> ...
3
votes
1answer
55 views

XML domains(lookups): Prevent duplicates between domains

Background: I have some GIS domains (a.k.a. lookup tables) that are stored in an XML column in a single system table. The domains are not directly accessible via SQL, so I use a view to extract the ...
0
votes
1answer
26 views

how to Upload xml data to db Table by check primary key in oracle

i want to upload xml file data to db table by checking the primary key and wants update the each row data.Here trid getting as a primary key.example OFF 1133 2388977 is their any solution ...
11
votes
1answer
422 views

SQL Server Query Plan XML: QueryPlanHash Length

UPDATE: This is definitely a bug. For full details see this Connect Item. While testing some changes to sp_BlitzCache (full disclosure, I'm one of the authors), I came across what I thought was a bug ...
4
votes
1answer
2k views

Read system_health event_file instead of ring_buffer for deadlocks extended events

I'm currently using this disaster to locate recent deadlocks by reading the system_health Extended Events ring buffer. select top 2000000000 XEvent.value('@timestamp', 'datetime2(3)') as ...
0
votes
1answer
70 views

MS SQL DB design help

I'm stuck with table design and query FOR XML Sync engine for Ads requires XML schema in this format <attribute1>value</attribute1> <attribute2>value</attribute2>… <...
0
votes
2answers
93 views

Update Table contents from another table

I want to update the products table from my store db from a temp table.. the production table 'Products' needs to update all columns from the temp table 'tmpprod' based on StockCode and not change any ...
11
votes
2answers
3k views

How To Read HTML code as XML and get the output like the sample in sql?

I have HTML code stored in the data base, and I want to read it as XML. My codes: http://rextester.com/RMEHO89992 This is an example of the HTML code I have: <div> <section> &...
8
votes
1answer
847 views

Determine the PackageFormatVersion for multiple .DTSX packages files in a folder

Kenneth Fisher put a blog post out about how to determine What SQL Version is My SSIS Package? in April, 2015. It has a table of which SQL versions map to which PackageFormatVersion of the SSIS ...
0
votes
1answer
32 views

Building and analyzing trends in a database [closed]

I am quite new to working with databases but have spent a few hours reading about XML and trying to understand the use of CML for building databases and find myself completely at a loss. Here is what ...
0
votes
1answer
3k views

Oracle sql query to xml

I have the below query. SELECT DISTINCT P.PLAYERID, P.FIRSTNAME, P.LASTNAME, P.POSITION,PT.POINTS, PT.MINUTES, CALC_TENDEX(P.PLAYERID, PT.TEAMID, 2009) TENDEX, T.DIVISION, PT.TEAMID, T.TEAMNAME FROM ...
0
votes
1answer
5k views

SQL Server - export tables to XML files

I need to export all tables (500) of a sql server 2008 R2 database to XML. What is the best and fastest way to do that?
11
votes
2answers
2k views

When converting dynamic SQL (pivot query) to xml output, why is the first digit of the date converted to unicode?

I am using this great example https://dba.stackexchange.com/a/25818/113298 from Bluefeet, to create a pivot and transform it to xml data. Declaring the param DECLARE @cols AS NVARCHAR(MAX), @query ...
0
votes
1answer
152 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 ...
2
votes
1answer
3k views

Insert XML File into specific sql table

I have the following xml document <XML_Articles> <Articles> <ID>12</ID> <ReferenceNum>123</ReferenceNum> <ArName>الهدف</ArName> <...