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

learn more… | top users | synonyms (1)

1
vote
2answers
90 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 ...
0
votes
1answer
30 views

SQL to XML with multiple values

Hello I'm new to converting SQL to XML. I have been trying to get this to work for the past few days. SELECT Item.foldername AS "foldername", Item.status, Item.vhrid, Item.firstname, ...
4
votes
1answer
44 views

How to read multiple record from xml to insert in table in SQL?

DECLARE @tbl_XMLResult table ( Status varchar(50), Address varchar(100), ListPrice varchar(25), SoldPrice varchar(25), YearBuilt varchar(25), SF varchar(25), Acres ...
0
votes
1answer
31 views

How to read and process xml data from stored procedure in sql server?

I am calling a stored procedure like this: usp_ReportResults @query = '759,905,1048,170,725,80129', @ReportName = 'GenRepot' where usp_ReportResult is defined as CREATE ...
6
votes
1answer
97 views

How to better use CLR Function from performance point of view (repeat inside each DB or have general function)?

I asked a question about validation of XML using XSD schema inside SQL Server 2012 (see link). I understand (as I suspected) that I need to use CLR Function. The function will get XSD schema text and ...
4
votes
1answer
87 views

Validate XML using XSD inside TSQL function in SQL Server 2012?

I need to validate XML using XSD inside TSQL. To make this task semi automated I need to do this inside TSQL function. To make validation I have to set value to XML and if it is not valid I will ...
1
vote
0answers
8 views

xmlforest() omits any fields that are null entirely, instead of creating an “empty” element

I'm know I can use an empty string, but I don't want to lose the null functionality in the database. In some cases null is appropriate and I can't use empty strings. Other than a empty string, how ...
2
votes
1answer
24 views

What's the relationship between Documents, XSDs and Collections?

I have a number of XML Schema Definitions describing business objects. It's unclear to me what the correct way to deploy these is if my intention is to make typed xml columns. The name Xml Schema ...
3
votes
2answers
44 views

OPENXML question for SQL Server

I am brand new to OPENXML, and have 90 % of what I want to do working...stuck on this: <ReportHost name="411.114.42.42"> <HostProperties> <tag name="HOST_END">Wed Nov 11 ...
0
votes
0answers
11 views

Help with pure xml query

I work on mainframes and I have got this one off request on purexml which I have to complete. I will be receiving an xml file, which I will be inserting in a DB2 column declared as xml, for schema ...
2
votes
2answers
96 views

Parsing Typed XML with a default namespace and inconsistent root node

I have a structured, typed xml file. <WebService xmlns="http://www.orbis-software.com/WebSvcCon"> <NewLeads> <OutputSchema> <root xmlns="" type="array"> <item ...
11
votes
1answer
345 views

How can I shred this Extended Events XML as fast as possible?

I created an Extended Events session in SQL Server 2008 R2. The session runs, and collects events as they happen, exactly like you'd expect. If I shred the xml when there are relatively few events, ...
1
vote
1answer
43 views

Procedure completes prematurely after converting comma-delimited value strings to XML

I have a procedure which executes beautifully within SSMS environment yet, when I hook it up to a web page, instead of seeing a list of packageIDs returned, the return is 'null'. I've checked ...
1
vote
3answers
169 views

Can FOR XML PATH return NULL for an empty resultset?

I would think this query select null for xml path('foo') would return NULL, but actuality <foo/ > is returned. Is there any way to achieve this behavior? To clarify, the behavior I would ...
2
votes
1answer
25 views

View created from XML data - Statistics

I am looking at a legacy system that stores XML blobs A view is created over this so the data is more accessible (for reporting) CREATE view [dbo].[Data] as select top 100 percent ...
4
votes
2answers
52 views

Is there a FOR XML variant that can add attributes with arbritrary values?

I'm trying to create a query similar to this SELECT 'foo' AS Detail, 'bar' AS Detail, 'baz' AS Detail FOR XML PATH ('Header') To produce something like this- <Header> <Detail ...
9
votes
4answers
218 views

Modify XML: attributes into elements

I have an XML column that contains data with similar structure: <Root> <Elements> <Element Code="1" Value="aaa"></Element> <Element Code="2" ...
3
votes
1answer
202 views

Convert Byte Array From XML to VARBINARY

I receive image files as XML data, each byte of the image being a node with its decimal value, e.g. for this example .png file, , the xml I get is: DECLARE @xml XML = N'<?xml version="1.0" ...
0
votes
0answers
50 views

MySQL Load XML Infile with dynamic file name

I have a shell script which loops through a folder and picks up a set of files in turn. I then pass the filename to a .sql script so that the file can be imported into my database. BUT, I can't for ...
0
votes
1answer
93 views

XML load fails on postgresql 9.1, but not in 9.3, any workaround?

I have a problem loading an xml on an xml field of a table. The load is done by ruby code, but this is not the point. Everything worked well for years, but xml is increasing size.... So one day, ...
0
votes
0answers
18 views

How to deploy XSD from SQLCLR?

I have few SQLCLR functions implementing business logic that return SqlXml data. I would also like to make the Xml Schema Definitions in the dll available in Sql Server. It's not a ...
1
vote
1answer
69 views

How to extract xml attribute from a column?

I have a column called target_data in the sys.dm_xe_session_targets that returns the path where the pertinent file resides in the format of xml tags. This data is not in XML datatype. One has to cast ...
0
votes
0answers
62 views

Reading XML content

Please assist. I want to read the following xml file using Oracle database. Fields that I want to see are class, limit and sel. This Xml is stored in a database table as a field/column. Thank you ...
5
votes
2answers
174 views

Import XML files into SQL Server 2012

Every Friday I have to import a couple (sometimes more than 300) of XML files into 2 tables. The structure of one of the tables, R000000, looks like this: R00000010 | R00000020 | R00000030 | ...
4
votes
2answers
342 views

Exporting results to XML

I am trying to create an XML file from a SQL query. The out put should look like the image below Where the tag BranchID appears again as SubParentBranchID if there are more than one SubBranchID ...
1
vote
1answer
30 views

putting together contents of XML column - from all rows of a table - how to get it done without a “while”?

I have a table called sizeguide with the definition you can see below. I am interested in the SizeGuideXML column, which is type XML. I had a mission the objective was, for each SizeGuideDesc, get ...
2
votes
2answers
70 views

How to query the XML data type? - Example

I know this question might have already been asked, but I am still trying to figure it out how to query the xml data and I really need an example. I have the following XML code that is inside a ...
0
votes
1answer
62 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' ...
7
votes
1answer
243 views

Replace value of strongly typed xml element in SQL Server with XQuery

Given a element, defined within an XML Schema Collection as such: <xsd:element name="xid"> <xsd:simpleType> <xsd:restriction base="xsd:string"> ...
1
vote
1answer
242 views

How can I pass the server name as parameter for a XMLA script?

I have a PROCEDURE sp_backupSSAS - it backups SSAS databases. it works fine. I had previous problems with it, but they were sorted out here: routine to backup ssas databases fails with: The XML for ...
6
votes
1answer
67 views

Why does assigning FOR XML to an XML variable warn about CONVERT_IMPLICIT(XML)?

SET STATISTICS XML ON; DECLARE @x XML = (SELECT 'hi' "@id" FOR XML PATH ('this'), root ('xml')); Type conversion in expression (CONVERT_IMPLICIT(xml,[Expr1001],0)) may affect ...
3
votes
1answer
104 views

Function Based Index with XPATH extractValue

// Oracle Version 11.2.0.4 Standard Edition // OS RedHat I am trying to create a function index on a large table, based on using an XML object. So I have done stuff such as: CREATE INDEX ...
1
vote
1answer
105 views

MySQL - include a default value in LOAD XML INFILE statement

I have the follwing table: CREATE TABLE `tab1` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `DEFAULT` VARCHAR(25) DEFAULT NULL, `ITEM` varchar(25) DEFAULT NULL, `TIMESTAMP` TIMESTAMP ...
2
votes
1answer
22 views

Returning XML Value for Extended Event

I would like to get the filepath for my extended event event_file and put it inside a variable but I'm stuck. Here's what I have: DECLARE @ExpensiveXML XML SET @ExpensiveXML = (SELECT ...
3
votes
1answer
52 views

How to call modify() on a nodelist in T-SQL?

I have a process step where I have an XML document in a SQL Server column and I need to alter the text of a node that could occur multiple times. Modify() with 'replace' DML only operates on single ...
0
votes
2answers
38 views

Should I use XML for data storage on client side?

I have to create a supplementary program that runs offline on a client machine (normally windows 7 or higher laptop). Of course, I don't want to create a pre-requisite for this program. Since this ...
0
votes
1answer
69 views

Database structure for object with dynamic attributes

I am developing a proof of concept for a personalized email sending web application (like MailChimp, but with premade dynamic templates). The general structure is that I have my templates (different ...
0
votes
3answers
326 views

SSIS - Best way to insert large number of rows

So here's the scenario: I have an XML file, which is in size of 500GB, and with data of around 600 million rows (once on a database table). I'm using SSIS for the operation, and since it consumes a ...
1
vote
1answer
239 views

How to update/insert/inject nodes into XML

I have an application which stores optional Site information in an XML field. Sample table: CREATE TABLE [dbo].[Sites]( [SiteID] [int] IDENTITY(1,1) NOT NULL, [SiteName] [nvarchar](80) ...
6
votes
2answers
923 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 ...
5
votes
2answers
4k views

How do I import XML to a SQL Server table?

Can anyone help me work towards fixing my solution to import my XML data into a SQL Server Table? I have done my research, but this task has been very hard for me to accomplish. Everything I have ...
1
vote
1answer
160 views

sql org chart hierarchical table to xml json

I have a table of employees and managers: create table emp_mgr (emp varchar(99), mgr varchar(99)) insert into emp_mgr select 'Adam',NULL; insert into emp_mgr select 'Bob','Adam'; insert into emp_mgr ...
3
votes
2answers
53 views

Shreded system_health ExEvent not returning all node information

SQL Server is not returning all node information when I shred the deadlock XML from the 2012 system_health Extended event. When I run the following query SELECT ...
10
votes
1answer
158 views

Why is the secondary selective index not used when the where clause filters on `value()`?

Setup: create table dbo.T ( ID int identity primary key, XMLDoc xml not null ); insert into dbo.T(XMLDoc) select ( select N.Number for xml path(''), type ) from ( ...
0
votes
1answer
112 views

Querying XML with Unicode data

I'm trying to select attribute value from XML column using XPath with a parameter that can be a Unicode string. Could you please tell me how to make these two examples work? create table #test ( ...
1
vote
2answers
464 views

Collation conflict when running dynamic sql FOR XML PATH

I am getting the following error message when running the query below: Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "Latin1_General_BIN" in the equal to operation ...
1
vote
1answer
51 views

How do I use a SP in SQL Server 2014 to call a external XML source?

I am attempting to retrieve Currency Exchange rates from http://www.floatrates.com/daily/usd.xml using a SP in SQL Server 2014. The result is in XML. So I created the following SProc: --DROP ...
3
votes
2answers
85 views

XML vs. Relational databases?

I feel like this isn't the best question to ask on a programming site like this, but I haven't really found a satisfying answer online and I would really like to get a different perspective on this. ...
0
votes
2answers
198 views

xml parameter to distributed query - difference between SQL2005 & SQL2012

I have inherited an old SQL2005 Enterprise database (on Windows 2003) that allows an xml parameter to a distributed query such as this: exec sp_executesql 'exec [server].[database].dbo.sproc ...
0
votes
1answer
27 views

Can SSRS XML data sources contain spatial data?

I've been given the task of producing a report which will extract data from a web service. The web service provides data from a list of sites including aggregates. Lets say total sales by month. ...