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
4
votes
1 answer

openxml with name space

Can some one please help to extract this: 876 I am using: DECLARE @xml_hndl INT EXEC…
4
votes
1 answer

Bulk insert nested xml with foreign key as identity column of first table

I have an xml as follows: Best of Pop ABC studio John 36
nikhil
  • 155
  • 4
  • 12
4
votes
3 answers

XMl parse in SQL Server

I have this xml structure.I use the following sql to read the values but it doesnt work DECLARE @x XML = '
user1361208
  • 109
  • 1
  • 7
4
votes
1 answer

How to pass a variable into XPath of XQuery in an SQL statement

Scenario: I have an xml column in MSSQL database which I have to parse the XML data of that cell using XQuery . Xml content :
stackOverFlow
  • 41
  • 1
  • 2
4
votes
1 answer

Split FOR XML PATH results into separate rows

I have the following query: SELECT 101 AS TeacherID ,s.ID ,s.First ,s.Last FROM dbo.Students s FOR XML PATH('Student'), ROOT('Students') which generates output: 101 14
jkh
  • 3,618
  • 8
  • 38
  • 66
4
votes
1 answer

How to populate an empty XML node using modify replace on an XML column?

This is my xml stored in an XML type column called UserDef abc123 .... ... I'm trying to populate the…
FMFF
  • 1,652
  • 4
  • 32
  • 62
4
votes
3 answers

SQL server insert data from table into an XML variable

How can I insert a whole bunch of rows into an XML variable without using a cursor? I know I can do SET @errors.modify('insert { sql:variable("@text") } as last into /errors[1]') to insert the value of a variable, but I want to…
erikkallen
  • 33,800
  • 13
  • 85
  • 120
4
votes
1 answer

How to handle SQL DateTime conversion from XML input in a common way

I have data coming into a Stored Procedure as an XML. One of the elements is a DateTime value. Sometimes when I get the value it has the "Z" timezone designation, other times is might not. I am looking for some way to always retrieve the date value…
Jay
  • 2,644
  • 1
  • 30
  • 55
4
votes
3 answers

How do I update an XML column in sql server by checking for the value of two nodes including one which needs to do a contains (like) comparison

I have an xml column called OrderXML in an Orders table... there is an XML XPath like this in the table... /Order/InternalInformation/InternalOrderBreakout/InternalOrderHeader/InternalOrderDetails/InternalOrderDetail There InternalOrderDetails…
Seth Spearman
  • 6,710
  • 16
  • 60
  • 105
4
votes
1 answer

Entity Framework to Query Xml

I have an issue. Perhaps one of you experts can help out here. The table that I am querying has 2 xml columns. I need to perform query on xml data in these columns too ( in my advanced search functionality ). Problem is I am using Entity Framework…
Ali Nahid
  • 867
  • 11
  • 26
4
votes
2 answers

Select XML nodes as attributes

I am assuming the answer to my question is going to be something simple which I can't figure out myself. Here is the scenario: I am using SQL Server 2008 R2 where a table has an XML column where the data is saved in the following format:
Wiz
  • 477
  • 5
  • 17
4
votes
2 answers

XML Schema Error: Required white space was missing

I have been searching on this for hours and can not figure out the issue. Could someone please help me with this? I am getting the above error when Executing a SQLXMLBULKLOAD in VB.NET 2010. I have attempted changing my xml declaration, my schema…
Josh McKearin
  • 742
  • 4
  • 19
  • 42
3
votes
2 answers

Using OPENXML in SQL Server 2008 stored proc - INSERT order differs from XML document

I'm using SQL Server 2008's XML-parsing abilities to iterate through an XML document and perform an INSERT each element. However, my stored procedure appears to be inserting each element into the table in an order which differs from the order in the…
awj
  • 7,482
  • 10
  • 66
  • 120
3
votes
1 answer

using SQLXML in ADO.NET, who needs to dispose?

I cannot find an documented answer to this question. If I'm using a SqlXml object to pass a xml to a StoredProc, who is responsible of disposing the XmlTextReader I'm creating? From what I found so far, the constructor already creates a copy of the…
Martin Moser
  • 6,219
  • 1
  • 27
  • 41
3
votes
1 answer

SQL pivot dynamic columns out of an nvarchar column containing xml

I have been given a table with the following columns and some example data: ID Title FieldsXml [nvarchar(max)] -- ----- ------------------------- 1 A x1y1 2 B …
Dennis George
  • 1,495
  • 2
  • 10
  • 18
1 2
3
31 32