Questions tagged [sqlxml]

SQLXML is a feature in MS SQL (introduced in SQL Server 2000), that enables XML support for making queries and processing data.

SQLXML was introduced in MS SQL Server 2000, and adds support for MSXML library into SQL Server. It allows the user to execute SQL SELECT statements that return XML instead of tabular data. In later versions(from SQL Server 2005), the XML support was extended with adding xml as a type in MS SQL Server to support XPath and XQuery over tables.

More info can be found in SQLXML's page in MSDN: http://msdn.microsoft.com/en-us/library/aa286527.aspx

471 questions
0
votes
1 answer

parse xml with attributes and values

I have a sql query to fetch values from an xml. Below is the structure of xml xyz Mobility Story Workflow
mhn
  • 2,660
  • 5
  • 31
  • 51
0
votes
2 answers

Inserting a dynamically built 'for xml' statement into a table or variable

I've got a situation where I'm trying to get a list of unfilled fields from a temp table into a comma separated statement. So given the example data (which will always be a single row, and probably in a temp table (as the actual data will come from…
cjb110
  • 1,310
  • 14
  • 30
0
votes
2 answers

Selecting from XML field where XML field = X and another XML field = Y

So to build off of this question, Selecting from XML field where XML field = X, and using the same SQL Fiddle, http://sqlfiddle.com/#!3/7c0a0/5. I can't seem to figure out how to grab the record that has both an item that has a FIELD with the value…
Chris Whisenhunt
  • 351
  • 2
  • 20
0
votes
1 answer

SQL CAST from XML

I try to CAST a XML Value e.g. 0.19 to INT and calkulate it with * 100. But I get an error like: Error by converting nvarchar-Value '0.19' in the INT Type. This is the Code: (but the Row with the "CAST" is the Problem) insert into BELEGP(Kennung,…
user2675045
  • 193
  • 1
  • 1
  • 8
0
votes
1 answer

T-SQL XML to retrieve attribute value and the respective element value

I have an XML column in a table. This column is called UserDef. The Xml looks like this: 002 AUT XYZ ABC
FMFF
  • 1,652
  • 4
  • 32
  • 62
0
votes
1 answer

Getting node value for data that is outside of a tag

I have an xml fragment and I want to get the value of a within a tag that is not within another tag. SET @xml = ' Cat Black Orange White ' SELECT @xml.value('/data[1]',…
James A Mohler
  • 11,060
  • 15
  • 46
  • 72
0
votes
1 answer

XML with content between tags

I have SQL SELECT '' AS "dfn", CCFKeyType AS "dfn/b", GroupID AS "dfn/var", ID AS "dfn/code" FROM ( ... ) A FOR XML PATH('') AND it generates cid 0115 EXS I would like to generate:
James A Mohler
  • 11,060
  • 15
  • 46
  • 72
0
votes
1 answer

Return XML document from SQL Server 2008

I have a template of an Excel XML document. Is there anyway I can build the XML document is SQL and have SQL Server return the XML document to me via stored proc.? I am trying to see if SQL Server can not just return the data for the spreadsheet but…
Kyle Johnson
  • 763
  • 1
  • 13
  • 31
0
votes
1 answer

How to use SQL XML and XMLAGG to return multiple xmlelements

In SQL, I need to create xml code that looks like this: Mobile 801 9996666
user2414410
  • 5
  • 1
  • 4
0
votes
1 answer

Concatenate multiple rows in one row

I've been trying to do this until I can't figure it out how, I just wanted to concatenate multiple rows into one row and make it the value of the final column query. To illustrate; Initial Query: ColumnOne --------- Row1 | 1 - One …
mirageservo
  • 2,387
  • 4
  • 22
  • 31
0
votes
1 answer

How to parse XML nodes in SQL Server by attribute value

Recently I faced a problem with parsing XML file via T-SQL script (in SQL Server 2008 R2). The task is to retrieve data (indicators) on certain date. I managed to retrieve the data on all dates. But I need to represent it like |Date |…
user2232196
  • 79
  • 2
  • 3
0
votes
2 answers

XQuery parent and child

Example: DECLARE @XML XML = '
Ragys
  • 9
  • 3
0
votes
1 answer

Query SQL XML field on type

So I've got an xml field in my DB. Sometimes what I'm doing fails and I get the following in my field: No response received! How do I query my DB to return all rows where the xml field contains an errorMessage XML? So…
Liam
  • 27,717
  • 28
  • 128
  • 190
0
votes
2 answers

SQLXML in SQL server

I'm having an small issue with SQLXML in SQL Server 2008. Here's my testing SQL query DECLARE @XMLTable TABLE(GameHistory XML) INSERT INTO @XMLTable VALUES( ' white
Matt
  • 6,264
  • 10
  • 54
  • 82
0
votes
3 answers

Group by a result of a xml query

I have table with a XML column (called MetaData) which looks like this: Now I have some…
rekire
  • 47,260
  • 30
  • 167
  • 264