Skip to main content

Questions tagged [xml]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
68 views

Loading XML to table producing nothing

I'm trying to import part of an xml file into a SQL Server database, but while the query successfully executes there is nothing in the table. XML: <?xml version="1.0" encoding="utf-16"?> <...
Exostrike's user avatar
  • 173
2 votes
1 answer
94 views

Explanation of Extended Events xml

I queried an Extended Events session and returned the XML. I am confused on what frame level 1, 2, 3 mean. As well as line, offsetStart and offsetEnd? I am however able to convert the sql handle to ...
nkdbajoe's user avatar
  • 194
2 votes
1 answer
820 views

Update xml based off datatype

I need to update a value in my xml datatype column, currently I am able to pull specific values using Select AllUserData.tp_ColumnSet.value('nvarchar13[1]', 'varchar(max)') AS AssetId... My data in ...
I'm here for Winter Hats's user avatar
10 votes
2 answers
4k views

Return xml sequences where an attribute doesn't contain a specific character

Consider the following simple XML: <xml> <customer name="Max"> <email address="[email protected]" /> </customer> <customer name="Erik"> <email address="erik@...
Hannah Vernon's user avatar
  • 70.2k
6 votes
2 answers
854 views

How to write this SQL query for a XML type?

I am using SQL Server 2012 in which I have a table [abc] which has a column called [Information] of the [XML] type. This column has values like - <Information> <Groups> <...
Maximus's user avatar
  • 161
0 votes
1 answer
277 views

XML parsing failed in the sqlplus

I get following error when executing the query Invalid token in '[count(../[name(../)=name(.)])=count(../) and count(../*)>1' However when installing the Itstar_xml_util package, it asks for two ...
Felipe Duarte's user avatar
1 vote
1 answer
2k 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) ...
Herman vereycken's user avatar
0 votes
1 answer
48 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 ...
Robby Johnston's user avatar
2 votes
1 answer
172 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>{$...
tre's user avatar
  • 21
1 vote
1 answer
181 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</...
Jason's user avatar
  • 69
2 votes
1 answer
2k 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 ...
Wayne Rossi's user avatar
0 votes
3 answers
5k 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 ...
SQLserving's user avatar
0 votes
1 answer
79 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 ...
Bogdan Bogdanov's user avatar
9 votes
1 answer
12k 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 ...
TimNewman's user avatar
3 votes
1 answer
8k 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....
V_immo's user avatar
  • 103
3 votes
1 answer
11k 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> <...
V_immo's user avatar
  • 103
4 votes
3 answers
3k 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 ...
Greg's user avatar
  • 574
0 votes
1 answer
38 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&...
harrison.kirby's user avatar
0 votes
1 answer
3k 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 ...
Dave Nixon's user avatar
1 vote
1 answer
200 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> ...
Joe's user avatar
  • 359
5 votes
1 answer
12k 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 ...
AKDiscer's user avatar
  • 1,385
6 votes
1 answer
2k 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 ...
Danny Rancher's user avatar
3 votes
1 answer
1k 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> <...
Joe's user avatar
  • 359
-4 votes
1 answer
3k 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> <...
user135088's user avatar
7 votes
2 answers
1k 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" ...
Riley Major's user avatar
  • 1,903
5 votes
3 answers
10k 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> ...
Joe's user avatar
  • 359
1 vote
1 answer
148 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 ...
bugo99iot's user avatar
3 votes
1 answer
5k 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 ...
Seb's user avatar
  • 51
1 vote
3 answers
1k 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". ...
sqlprincess's user avatar
2 votes
2 answers
2k 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. +----------+--------------------------------------------------------------------...
Ludisposed's user avatar
1 vote
0 answers
60 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) &...
Nick's user avatar
  • 111
4 votes
1 answer
51k 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 ...
Abhay's user avatar
  • 41
4 votes
3 answers
669 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 ...
Raidenlee's user avatar
  • 153
1 vote
0 answers
528 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> <...
Nikesh Kedlaya's user avatar
0 votes
2 answers
97 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....
LJKims's user avatar
  • 123
1 vote
1 answer
398 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/...
BuahahaXD's user avatar
  • 1,405
-2 votes
2 answers
699 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, [...
Patrick Stewart's user avatar
2 votes
1 answer
2k 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 ...
iainH's user avatar
  • 121
4 votes
1 answer
6k 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> <...
McNets's user avatar
  • 23.8k
0 votes
1 answer
81 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 ...
AlexP's user avatar
  • 1
2 votes
2 answers
13k 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> ...
Mel's user avatar
  • 23
3 votes
1 answer
68 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 ...
User1974's user avatar
  • 1,477
0 votes
1 answer
39 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 ...
Randula Salgado's user avatar
14 votes
1 answer
586 views

SQL Server Query Plan XML: QueryPlanHash Length

This is definitely a bug. Details were on the old Connect site, and are no longer available, as it has been retired in favor of an indeterminate number of other solutions, both third and first party. ...
Erik Darling's user avatar
  • 41.9k
5 votes
1 answer
3k 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 ...
crokusek's user avatar
  • 2,120
0 votes
1 answer
103 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>… <...
DataDev's user avatar
0 votes
2 answers
403 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 ...
Justin Bland's user avatar
11 votes
2 answers
5k 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> &...
RedArmy's user avatar
  • 271
8 votes
1 answer
2k 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 ...
John G Hohengarten's user avatar
0 votes
1 answer
35 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 ...
Avaneesh T's user avatar

1 2
3
4 5
8