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

learn more… | top users | synonyms (1)

1
vote
1answer
2k views

Store FOR XML result in xml variable (using WITH statement)

I am creating xml with a SQL query that works like this: First a CTE, then the SELECT statement that creates the XML. That works. However I would like to store the output in a XML variable (a table ...
7
votes
1answer
146 views

IN and NOT IN for XML column

I have a table with a xml column. Xml is similar to <Root> <Row> <user>abc</user> <Rowid>1</Rowid> </Row> <Row> ...
5
votes
0answers
282 views

SQL Server Sproc calls from IBM Cast Iron orchestration with XML payload fail

I'm hoping that someone on this forum may have experience with an IBM appliance, Cast Iron (Websphere), and how it interacts with SQL Server. I know very little about the Cast Iron appliance, and its ...
3
votes
1answer
416 views

Sql Server 2012 Extended Events for Selective Xml Indexing not showing results

I created a Extended Event to monitor and tune a Selective Xml Index CREATE EVENT SESSION [SelectiveXmlIndexing] ON SERVER ADD EVENT sqlserver.selective_xml_index_no_compatible_sql_type, ADD EVENT ...
-1
votes
2answers
3k views

Query to search for a substring in xml

I use below query to search for a substring in whole xml(including node name and node value) SELECT * FROM tablename WHERE ( Charindex('abc',CAST([xmlcolumn] AS VARCHAR(MAX)))>0 ) I want an ...
1
vote
1answer
192 views

Relative cost of two similar queries involving XML columns

I have two queries as shown below which do the same thing. Here xmlcolumn is a column with datatype XML. I use these queries to search for a string anywhere in the XML column. I checked the execution ...
0
votes
1answer
241 views

xml queries with exist and contains giving unexpected results

I have a query as shown below. DECLARE @tbl TABLE ( id INT, col XML ) INSERT INTO @tbl VALUES (1,'<Root> <Row> <User>xyz</User> ...
1
vote
0answers
283 views

Search for string in xml column

I am using sql server 2008 r2 express. I have a table with column name 'xmlmycolumn' which is of datatype xml. I want to search for string in that whole xml. So to do this i am casting column as ...
7
votes
1answer
927 views

Estimated vs Actual rows differences (actual much smaller than estimated) - sort

I'm running a query that is processing some nodes out of an XML document. My estimated subtree cost is in the millions and it seems it all comes from a sort operation sql server is performing on some ...
1
vote
1answer
175 views

Any way to estimate the required space for a SQL dump file?

I want to import a Wikipedia XML dump file into MySQL. The uncompressed XML dump file is 65GB. Does this mean I should free up almost 64GB in the MySQL data path? Is there any way to estimate the ...
1
vote
1answer
1k views

Oracle Select with xmlquery() error - How to ignore errors?

In trying to extract a subset of data from a Oracle DB table, one of the columns is XMLType, which is extracted with xmlquery() for relevant information. The problem is that the XML data is from an ...
0
votes
3answers
1k views

SQL agent job step's connection managers

Is there any way with T-SQL to list the connection managers that are used in an SQL Agent Job step?
6
votes
1answer
510 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. ...
0
votes
3answers
157 views

Built-in XML functions

I am trying to use built-in XML functions, but I'm getting an %s: invalid identifier error. Selects works fine without the XML functions. Any ideas where is the mistake? select id,full_name from ...
0
votes
0answers
265 views

XML Data convert to SQL database,

I have an XML feed that i need to parse daily, i want to store all of the data from the XML feed in a SQL table so then that data can be queried and manipulated by my clients. I can currently parse ...
0
votes
1answer
140 views

Query not returning items in the original order

Consider the following set, which is the content of the table variable @ProductContent that was just created for the query that runs against it: Notice how items are sorted by media_type_id, ...
2
votes
2answers
952 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 ...
3
votes
1answer
577 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> ...
2
votes
2answers
691 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 ...
3
votes
1answer
957 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 ...
1
vote
1answer
6k views

What is the best way to insert a XML input to an oracle table in stored procedure?

I want to write a stored procedure which has a XML input (clob type) and inserts the data to a table. my XML structure is something like this: <rowset> <row> ...
2
votes
0answers
308 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 ...
5
votes
1answer
369 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 ...
2
votes
1answer
185 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'), ...
4
votes
1answer
226 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 ...
2
votes
1answer
482 views

ORA-16000 when trying to perform select on read only Oracle database

My application's SQL encounters an ORA-16000 error when trying to access a read only Oracle database. ORA-16000: database open for read-only access ORA-06512: at "SYS.XMLTYPE", line 272 ORA-06512: ...
1
vote
1answer
382 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
3answers
436 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 ...
7
votes
1answer
873 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, ...
1
vote
0answers
235 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 ...
17
votes
2answers
2k 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 ...
0
votes
2answers
579 views

how to select * from XML where id=1?

declare @xml xml, declare @num int set @num = 1 set @xml = ' <row> <Id>1</Id> <name>reza</name> </row> <row> <Id>2</Id> ...
1
vote
2answers
212 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 ...
0
votes
1answer
184 views

avoid insert xml duplicate data

how can to prevent duplicate inserts for every Execute? insert into IQ (XMLDT)values('<row>sdsdf</row>')
2
votes
1answer
1k 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> ...
5
votes
1answer
471 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 ...
2
votes
2answers
3k 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 ...
1
vote
1answer
863 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 ...
2
votes
1answer
120 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 ...
3
votes
1answer
2k 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 ...
4
votes
1answer
2k 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
6k 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
1answer
1k 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 ...
0
votes
0answers
388 views

Identifying XML Node Position in SQL Server 2008

I am having a problem identifying the node position that contains a particular element in a piece of XML. In the example below I would like to extract the position for each node within the statements ...
1
vote
0answers
120 views

XML parsing failed

I'm using a query on a oracle db which extracts values from clobs using the xmltype function and an xpath. Unfortunately the query fails and reports a 'XML Parsing failed'. I assume that one of the ...
0
votes
1answer
177 views

Parse message_body(XML)

I know the contents of @message_body are: <inserted DocNo="xxxx99999"/> I want to put 'DocNo' into a variable I created @DocNo and have tried various this such as: SET @DocNo = (SELECT ...
2
votes
0answers
270 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> ...
8
votes
1answer
307 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 ...
1
vote
1answer
633 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.
0
votes
1answer
559 views

How to convert data from XML format into Excel workbook or database table [closed]

I have some data that is given in a consistent XML format (which I can't change). I would like to import it into a database so that I can work with it, and then search, identify and export certain ...