Given that the XML field is named ‘xmlField’…
SELECT
[xmlField].value('(/person//firstName/node())[1]', 'nvarchar(max)') as FirstName,
[xmlField].value('(/person//lastName/node())[1]', 'nvarchar(max)') as LastName
FROM [myTable]
More Related Contents:
- SQL Server Xml query with multiple namespaces
- XML Server XML performance optimization
- Import ‘xml’ into Sql Server
- How to add xml encoding to xml Output in SQL Server
- How to query values from xml nodes?
- How to query for Xml values and attributes from table in SQL Server?
- Parse XML in SQL Server
- SQL Server – defining an XML type column with UTF-8 encoding
- Milliseconds wrong when converting from XML to SQL Server datetime
- Why do I get the error “Xml data type is not supported in distributed queries” when querying a linked server for non-xml data?
- Does the `nodes()` method keep the document order?
- Why insert-select to variable table from XML variable so slow?
- The Best Way to shred XML data into SQL Server database columns
- how to select next n letters after one specific letter using function in sql server by giving function name,specific letter, no of letters next
- SQL server query to output the data shown below
- Will ANSI JOIN vs. non-ANSI JOIN queries perform differently?
- What is the difference between Integrated Security = True and Integrated Security = SSPI?
- How to execute XPath one-liners from shell?
- How to use a variable for the database name in T-SQL?
- What is the difference between char, nchar, varchar, and nvarchar in SQL Server?
- Why is 1899-12-30 the zero date in Access / SQL Server instead of 12/31?
- RODBC odbcDriverConnect() Connection Error
- Calling an API from SQL Server stored procedure
- Is there a way to not use square brackets in SQL Server?
- How do you set autocommit in an SQL Server session?
- Default XML namespace, JDOM, and XPath
- Avg of float inconsistency
- How to apply the XPath function ‘substring-after’
- Is there an “IF EXISTS” test for a linked server?
- SQL Server stored procedure return code oddity