Questions tagged [xml]

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

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

How to transform results of a select statement formatted as XML?

When I run the command mysql EvePlanataryExpenses --xml -uuser -p -e "SELECT sTransactionDateTime, SUM(sQuantity * sPrice) as 'profit' FROM sell GROUP BY sMonth;" |sed '/^\s*$/d' I get the following ...
3
votes
2answers
2k views

Why store XML Schema in SQL Server 2012 database?

What a real world production environment example for storing and or using a XML schema in a SQL Server database? I am working my way though the Microsoft 70-461 exam objectives. I have completed ...
2
votes
2answers
3k views

xml parse in postgresSQL

I have a problem with parse simple xml: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <data-set> <department> <ID>1</ID> &...
2
votes
0answers
56 views

Insert records from output 1 to every record of output 2 from the same XML file in SSIS

I am using an XML document as a source in SSIS as below <?xml version="1.0" encoding="utf-8"?> <Doc> <Header> <ShipmentCode>ABC-EFG-123</ShipmentCode> <...
2
votes
2answers
4k views

Get a Table from XML in postgresql

Have a look at the following XML data: <data> <test color="red">Red text</test> <test color="green">green</test> </data> Let's say I have several xml-...
1
vote
1answer
842 views

SQL Server - How to compress XML inside Trigger?

I am using SQL Server Standard Edition 2012. When doing Audit using Trigger, the fields of the audited row(inserted or deleted) are being inserted into the table in XML Format. However, as observed, ...
7
votes
1answer
13k views

See if XML element exists at any level in document with a specific value

Is it possible to query XML to find if a particular element has a certain value? For example, if I wanted to see if the below XML has the value "Brandt" in <ContactFName>. But note, the ...
2
votes
1answer
3k views

PowerShell and SQL Server export XML

I have a stored procedure that ends with FOR XML EXPLICIT and I need to put the xml file in a folder. I've set up the following PowerShell, and run the script providing the two parameters. The ...
1
vote
1answer
608 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 ...
0
votes
1answer
188 views

DB2 XML indexes and “ORDER BY” clause

My table looks like this: CREATE TABLE "Content" ( "id" VARCHAR(36) NOT NULL, "xml" XML ); I have an index defined create index "idx_creation_date" on "Content"("xml") generate keys ...
3
votes
1answer
476 views

Generate lower case tag names with Oracle DBMS_XMLGEN?

I am generating XML in Oracle PL/SQL with the DBMS_XMLGEN package: OPEN base_cursor FOR SELECT * FROM foo; base_context := dbms_xmlgen.newcontext(base_cursor); base_xml := dbms_xmlgen.getxmltype(...
4
votes
1answer
2k views

Bringing web service data into SQL server

I need to retrieve a data set daily from a hosted Web service. I can retrieve the XML "column names" in an SSIS package. But I need to retrieve all the data in the data set in csv format or bring ...
0
votes
1answer
2k views

How to create xml from sql table?

I have sql table from which I am trying to get results based on some criteria as: From above table I want to create xml which has to return result as: Here is the query I have written for the ...
1
vote
1answer
879 views

what is the quickest way to check whether a XML column is empty ( @xml = '') in the where clause?

following the conclusion of the question how to test if XML = '' in sql server? to cut a long story short there is a procedure which has one of its parameters a XML variable @ListNoteTypeCode. It ...
2
votes
1answer
702 views

Where to find the size of SQL Server data types?

This question has already been asked here but none of the answers was really helpful in finding out the size for example, of a XML variable. declare @myVariable XML I have learned from this question:...
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 ...
0
votes
1answer
50 views

SQL and XML insert new Node

I have an SQL Query to make an XML Document. Everything works except one thing: A short insert of my SQL Query at this time is: select OITM.ItemCode, OITM.ItemName, OITM.Price Output in XML: <...
1
vote
2answers
1k views

Issue with getting data from XML file by using SSIS

I'm getting the data from XML file on the internet like below: <?xml version="1.0" encoding="ISO-8859-1"?> -<exchangerates type="Exhange rates" xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
1
vote
1answer
114 views

SQL parsing XML

I'm receiving XML files as part of an EDI setup and I'm having an issues getting information from the child elements. Here is the XML file: <?xml version="1.0" encoding="UTF-8"?> <cpi_event&...
2
votes
2answers
416 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
2answers
4k views

Get attribute value of XML

I went through at least 5 question on SE, but I must be doing something very bad out of frustration already. I have a stored procedure that returns an XML like this: <pmsg:Messages> <...
4
votes
2answers
13k views

How to escape XML characters in TSQL before converting to XML?

I have XML structure which is input param for my stored procedure. It contains element with & (which is escaped in XML). When I extract that element to VARCHAR I receive & which is not valid ...
2
votes
1answer
1k views

Create an XML Schema collection in SQL Server 2012?

I want to create an XML schema collection to validate some XML in a column for the following XML: DECLARE @xml as xml SET @xml=' <R C="firstName" O="" N="Fred" /> <R C="lastName" O="" N=...
0
votes
0answers
781 views

Fastest way to shred large xml data into a table [duplicate]

I have a nightly process that shreds XML data from a 17 million row table (120 GB) into another table, it takes about 3 hours and inserts about 1.5 million records. I currently do a complete drop ...
2
votes
1answer
2k views

Trim a value in an xml column in MS SQL Server

I have a database with an XML column. I am trying to update (trim) an xml value of the xml column. I am running on Windows, SQL Server 2008 Express. I did not find any way to trim directly in Xquery ...
3
votes
1answer
1k views

How to script XML Schema collection in SQL Server 2012?

I need to make script of XML schema collections in my Database and then insert each xml inside a table field as string. I need to do this to compare current schema collections with the new schema ...
1
vote
2answers
1k views

XML column performance in TSQL

I'm finding very limited reading on how a large xml column affects table performance in sql server 2014/6. For reference, it is a 36gig table and minus one xml column, it is 36megs. Some queries ...
1
vote
3answers
11k views

SQL Server Select in XML field

I need a help with the situation below: In my table SQLServer 2012 have a field with xml values, I would like to make a select of the data in that field and show the result in the form columns. <...
7
votes
3answers
46k 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....
1
vote
0answers
756 views

How can I import data from a NetCDF file into SQL Server?

I'm being asked to investigate the feasibility of importing data from a NetCDF file into SQL server. The file could be upwards of 300-400Mb and provided 4 times a day. However I'm only interested in ...
19
votes
2answers
2k views

LOB_DATA, slow table scans, and some I/O questions

I have a rather big table with one of the columns being an XML data with an average size of XML entry being ~15 kilobytes. All other columns are regular ints, bigints, GUIDs etc. To have some concrete ...
7
votes
2answers
1k views

how to get estimated subtree cost?

If I have a query that returns a query_plan, for instance like this: SELECT TOP 1000 st.TEXT ,cp.size_in_bytes ,cp.plan_handle ,QP.query_plan FROM sys.dm_exec_cached_plans AS cp CROSS ...
3
votes
2answers
1k views

Incorrect syntax generating XML

I am trying to run below code in SQL server 2000 SP4 but getting error. Declare @Body varchar(8000); Declare @TableHead varchar(8000); Declare @TableTail varchar(8000); Set NoCount On; Set @...
8
votes
2answers
2k views

XML parsing slowly

I'm currently trying to tune a somewhat problematic stored procedure and I've noticed that majority of cost associated with running it comes from parsing parsing some XML into a temp table. Here is ...
3
votes
1answer
2k views

How to resolve this 'XML Validation: Declaration not found for element' error?

I'm new to SQL Server and I have this task to complete (for learning purposes), yet I'm unable to figure out this error due to inexperience with XML Schemas (I think) Here's what I'm trying to do - ...
3
votes
1answer
129 views

Help with SQL Server and XML columns

I am writing a query to run against the SCOM 2012 OperationsManager database. SQL instance is Microsoft SQL Server 2012 - 11.0.5058.0 (X64). Within the database is a table called Monitors. The schema ...
2
votes
2answers
2k views

Is there a way to validate XML using variable as schema?

Is there a way to declare XSD schema as variable inside a construct: DECLARE @xml XML(Books)? I need to make quick validation of XML using XSD schema which is declared as variable. I suppose there is ...
1
vote
1answer
29 views

How to convert different string value to respective 'YYYY' int format?

I'm inserting values into table from xml as: DECLARE @XMLRESULT XML DECLARE @tbl_XMLResult TABLE ( RowID INT IDENTITY(1,1), Status VARCHAR(50), Address VARCHAR(250), ListPrice INT, ...
-1
votes
1answer
2k views

want to import exported xml file in wamp phpmyadmin

I have exported single table from wamp phpmyadmin as xml file for data verification and want to import it again into database as mysql table. Please give me guidance, how its possible?
1
vote
1answer
823 views

Why SQL function always returning empty result set?

Following function I have write which accept xml and returns table as result. CREATE FUNCTION FunctionTest(@ID INT,@XML_Details xml) RETURNS @RESULT TABLE ( Value1 INT, Value2 INT ) AS BEGIN ...
0
votes
1answer
6k views

Selecting from a table contains a XML column

I have received an Excel file (verion 2010) and based on the requirement I was asked to save it as an XML file and then import into SQL data ready to be queried in normal SELECT statements. Below is ...
32
votes
1answer
4k views

Very strange performance with an XML index

My question is based on this: https://stackoverflow.com/q/35575990/5089204 To give an answer there I did the following test-scenario. Test scenario First I create a test table and fill it with 100....
3
votes
1answer
1k views

CLR Procedure with XML parameter returns Data at the root level is invalid. Line 1, position 1

I have following CLR stored procedure, which is throwing error on this command xmlDoc.LoadXml(inputXml); code public static int spGetTaxOfficeXML(SqlXml _inputXml) { // this ...
3
votes
1answer
752 views

Full text search in XML documents

I would like to do full-text search in XML documents. However, I can't get matches for attribute values (I get a syntax error if I provide the full attribute value including the : and / characters in ...
2
votes
1answer
3k views

Query XML without namespace

I can query XML, which has defined xmlns tag with common table expression DECLARE @XML XML SET @XML = '<NodeA xmlns="https://XYZ.xsd"> <NodeB verzePis=""> <NodeC1 attrA="Hello" /&...
2
votes
1answer
137 views

Howto query xml

My source data in a SQL Server table has XML structured data. For each of the source rows I need to query the following sample XML structure in a way that I get a calculated value of all A sub ...
4
votes
1answer
2k views

SQL 2012 CLR error: “The context transaction which was active before entering …”?

I am experience strange error with SQL 2012 and CLR: The context transaction which was active before entering user defined routine, trigger or aggregate "My routine" has been ended inside of it,...
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 ...
0
votes
1answer
51 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, Item....
3
votes
1answer
7k 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 varchar(...