Short for 'eXtensible Markup Language.' A textual markup language for transferring structured data.
13
votes
2answers
570 views
Optimising plans with XML readers
Executing the query from here to pull the deadlock events out of the default extended events session
SELECT CAST (
REPLACE (
REPLACE (
XEventData.XEvent.value ...
10
votes
4answers
3k views
When to use XML data type
I'm responsible for creating a database on a project. We have fields that are rarely going to have a value (1 in every 10,000 records) and I'm trying to work out the best way to store this in the ...
9
votes
4answers
1k views
How to store data in a database without tables?
All I learned in school was SQL which saves data to tables.
Right now I am working on a project where data is stored in XML-files. Additionally every XML contains a reference to visual files (JPEG).
...
7
votes
1answer
244 views
Variable for element name
I have this tSQL code which works OK:
SELECT
c.logguid,
a.b.value('./PropertyValue', 'varchar(max)') asd
FROM [dnn].[dbo].[EventLog2] c
cross apply ...
7
votes
0answers
111 views
Generate XML using Oracle XML schema
I have some XML schema definitions that have been registered using DBMS_XMLSCHEMA. I have created tables using the XMLTypes generated. I can create XML using XMLQuery and if I understand correctly, ...
6
votes
1answer
140 views
How to shred .docx XML?
I am trying to import a xml (actually a docx file) to a sql server 2008 database. I am almost a novice in XML programming. I googled a lot but almost all the examples there are with simple xml file. ...
5
votes
1answer
181 views
SQL Server / MySQL to DTD (+XML)
Is there any way I can at least export a table schema from MSSQL or MySQL to a DTD file? Also the same for the data of the tables to XML.
I am really not getting how to write DTDs, so I badly need a ...
5
votes
3answers
11k views
Read XML file in SQL Server 2008
How can I read an XML file and store the data in XML to our table in SQL Server 2008?
5
votes
1answer
117 views
What must be in place to validate a XMLTYPE against a schema?
I have a procedure that generates an XMLTYPE and I want to validate it against a schema. The problem is that there seems to be a permissions issue running createSchemaBasedXML because when I run the ...
4
votes
3answers
2k views
How to insert multiple records using XML in SQL server 2008
i use SQL server 2008 in my web application back end. Apparently i iterate through all the records from the C# code whenever there is a multiple insertion scenario. i have never tried the multple ...
4
votes
1answer
519 views
What is the difference between these two create table statements?
a)
SQL> CREATE TABLE xml_tab1(poDoc XMLTYPE);
Table created.
SQL> desc xml_tab1;
Name Null? Type
----------------------------------------- -------- ...
4
votes
2answers
162 views
How do I track the usage of XML indexes?
My XML indexes are not listed in sys.dm_db_index_usage_stats
Does this mean they aren't being used? Or does this particular DMV not track XML index usage? (Books Online doesn't appear to answer the ...
4
votes
1answer
631 views
T-SQL: Convert XML to string without self-closing tags
We have a weirdo system we're integrating with which consumes XML, but it does not understand self-closing tags, so
<BOOKING>
<BOOKINGID>56812</BOOKINGID>
<PERSONCODE />
...
3
votes
4answers
2k views
Is it possible to get SQL Server 2008 to download a file from a URL
I have a set of XML based services running on my network.
The data in these services needs to be mirrored into a Table on an SQL Server 2008 instance.
Getting the XML into a table is no problem I ...
3
votes
2answers
1k views
Select XML values when attribute involved
I have a table that stores XML values in field: OtherData.
An XML value from one row:
< file path="C:\WINDOWS\system32\svchost.exe" />
I would like to select all rows that have an ...
3
votes
3answers
3k views
SQL to read XML from file into PostgreSQL database
How can I write SQL to read an XML file into a PostgreSQL XML value?
PostgreSQL has a native XML data type with the XMLPARSE function to parse a text string to that type. It also has ways to read ...
3
votes
2answers
2k views
stored proc to handle XML as input param for multiple record inserts
i have updated my proc from taking typical data types to take a single XML param so that i can call it once instead of multiple times for inserting multiple records.
here is a sample of my proc that ...
3
votes
1answer
1k views
Storing XML in varchar(MAX) or use SQL-XML
I am defining a schema for a new set of resources using SQL Server 2008... In this case, each record (e.g. row) will need to store XML fragments. From time-to-time; although not frequently; I'll need ...
3
votes
1answer
72 views
How to Return XML Node Ordinal, or delete node based on element value?
I have an XML document similar to this:
<Root>
<Sub>
<Record>
<Guid>aslkjflaksjflkasjfkljsd</Guid>
</Record>
<Record>
...
3
votes
1answer
76 views
Item Index for all items in nested XML query
I have a requirement to build an XML package with a parent record, and 1..N related child records.
The child records are to be a nodes under the parent node, and there may be one child record or ...
3
votes
1answer
330 views
How do I merge two XML variables in SQL Server (2005/2008)?
Forward: I've already read this StackOverflow thread and it does not address the depth retention I need.
I want to create an XML document that contains the data definition objects for a single ...
3
votes
1answer
8k views
trying to turn XML into heirarchical SQL tables, can anyone provide a good explanation of two parts of this code example?
I am trying to learn how to turn XML into heirarchical SQL tables.
I have found an old code snippet from a Microsoft forum which is basically what I am trying to do, but I was wondering if someone ...
3
votes
1answer
59 views
Is it possible to use Oracle XMLTABLE and %type column type selector?
I am creating a stored procedure which gets an xml input and inserts the data to a table using XMLTABLE.
I want to know how can i specify a field type according to a table column type when passing ...
2
votes
2answers
481 views
Fast XML, slow XML
Our database update Windows application needs to transfer some data between two databases as part of the process for a certain one-time update. I chose XML as the intermediary to move the data.
The ...
2
votes
1answer
57 views
Would appreciate some advice on using external data with SQL Server 2005
I'm a web developer with a bit of DB experience, but this one is beyond my knowledge.
We're trying to set up a new website. The data - products, prices, descriptions etc - are supplied by an external ...
2
votes
1answer
222 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 ...
2
votes
1answer
42 views
FOR XML is generating a empty first line
I'm parsing with flash a XML file generated by this code:
:XML ON
USE MyDatabaseName
GO
SET NOCOUNT ON
SELECT * FROM ProgramacionDia as programa order by hora
FOR XML AUTO,
ROOT ('toflash'),
...
2
votes
1answer
1k views
Is this a good way to store XML data in SQL SERVER 2008?
I'm doing a feasibility study for storing data in the following structure with SQL SERVER 2008:
-MYTABLE
|ID|RECORDS|BRANCH_OFFICE|MONTH|YEAR
The RECORDS column has the XML data type and it will ...
2
votes
1answer
179 views
Where can I find information on shredding xml with .nodes?
I recently saw this answer on SO which uses the "local-name" value while shredding xml using .nodes(). I've never seen this before:
select T.N.value('local-name(.)', 'varchar(128)') as Name,
...
2
votes
2answers
679 views
SQL statement to combine main table and child table as columns?
Having a main table and a child table in a Microsoft SQL Server database (2005+), I want to show the user a single table in a grid view which includes rows from the main table and rows from the child ...
2
votes
1answer
260 views
how to convert xml to database table
input:
Declare @OUT xml
select @OUT = N'
<row>
<kind>MainCat</kind>
<sortid>1</sortid>
<kind_id>1</kind_id>
<PPoet>حافظ</PPoet>
...
2
votes
1answer
83 views
I would like to better understand the SQL Server security model in terms of users and groups to possibly replace an XML heirarchy model I am using
I am currently using XML in my database to represent metadata for individual products. I am using the below schema to enter the data. In each sub grouping of fields you will notice the cms_name ...
2
votes
3answers
106 views
Document versioning
I want to store in SQL Server 2008 XML files, but in a way that versioning is supported.
For example, I have a XML document and I save it in the DB(in the XML datatype column). After that, I edit it. ...
2
votes
1answer
689 views
How to remove xmlns from child elements with FOR XML
I have a TSQL query that I use to generate a SOAP document. I am using two namespaces. Namely:
- http://schemas.xmlsoap.org/soap/envelope/ for "packaging" the soap document
- A custom one that ...
2
votes
1answer
315 views
How can I escape XML field in XML-output query?
I have following request:
SELECT XMLAGG(data) FROM
(SELECT XMLELEMENT(name item, XMLFOREST(
title,
body as description,
date_created as date,
'http://example.com/news'||id as link
)) AS ...
2
votes
1answer
926 views
Best methods for ingesting XML into Oracle 11gR2
I have a large Oracle 11g Instance. I now have a requirement to convert large amounts of XML into records in several related tables.
The xml will arrive frequently at irregular intervals. The ...
2
votes
2answers
121 views
Loading XML documents to Oracle 11g DB with control file
I am using Oracle 11g XML database and trying to load XML documents to this DB with a control file and the sqlldr utility. All these XML files have an element that contains a date string with time ...
2
votes
0answers
117 views
Transform XPath map into XML document using relational data
Background
Most modern databases have XML functions that can be used to extract data in an XML format. I want to avoid the task of manually calling XML functions to extract the data.
This problem ...
2
votes
0answers
158 views
going from heirarchical XML to heirarchical SQL tables then SQL to c# objects to go to user view, how should I store the data in the databases?
Hi I'm getting my data from a web service using their getData call and it comes in as fairly chunky heirarchical XML, first everything all at once, like
<allData>
<product1>
...
1
vote
3answers
135 views
SQL Server xml performance
I have a table with 21 columns. The majority are numerical and the rest are nvarchar.
I need to add 4 columns that will contain XML data for each row. The XML data for each row can be anywhere from ...
1
vote
1answer
610 views
Select statement to retrive xml output as below
Hi could someone provide me some clues or solution to retrive record sets like below
note: i read the msdn documentation but leads me no where but hair loss :(
Just for the assumption think i have 2 ...
1
vote
2answers
142 views
XML Large DataBase is the best? [closed]
Is the best way to implement a large database is XML? Or is there a better way?
1 - reduce the time complexity
2 - Reduce the amount of traffic between the tables
And other factors ...
Which ...
1
vote
1answer
108 views
Mysql database design with XML
I intend to create a wiki webpage, but it has some few more limitations than regular wikis. The content is completely user-editable, but the structure of the page is determined previously. To make ...
1
vote
2answers
2k views
SQL Xml returning empty root tag on empty record set
I am working on xml explicit to generate user defined nodes in xml output using Sql Server 2005 Express edition. The below code works fine, just that i couldn't manage to generate a empty node when ...
1
vote
1answer
240 views
SSMS Oracle import using OpenQuery over LinkedServer (Oracle Provider for OLEDB) - XML Parsing: unable to switch encoding
I am trying to migrate the data from an OracleDB to an SQL Server Express database. I'm doing this by openquerying a linked server (data provider based on Oracle Provider for OLEDB). Everything works ...
1
vote
1answer
394 views
SQL Database to XML?
I would like to export SQL data to an XML file so it can be read in COBOL. I am working with SQL Express 2008 r2.
1
vote
1answer
120 views
SQL Server stored procedure working when run manually, not running from SQL Server Agent
I have a procedure that runs fine using the execute command in SSMS, however putting the same command in a job gives the following error.
line 9, character 9, unexpected end of input
The code ...
1
vote
1answer
297 views
How to remove column output in a for xml path query with a group by expression?
I forgot how to remove a column from being output in a FOR XML PATH query using a group by expression. I used it before but somehow I lost the article. In the below example. I do not wish to have ...
1
vote
0answers
165 views
FOR XML EXPLICIT problems in SQL Server 2005 Express
SQL Server 2005 Express Service Pack 2 w/Advanced Services
Windows 2003 R2
I recently migrated a database from MSDE 2000 to MSSQL 2005 that is used for a tourist website that can be displayed in one ...
1
vote
1answer
364 views
Trying to Build TreeView Query in T-SQL
I have parent records in two tables, Table1 and Table2. Some records in Table3 are children of Table1, and some are children of Table2.
I would like to build a query that I can use to populate a ...


