Home
|
Tutorial
|
Articles
|
Forum
|
Interview Question
|
Code Snippets
|
News
|
Fun Zone
|
Poll
|
Web Links
|
Certification
|
Search
Welcome :
Guest
Sign In
Register
Win Surprise Gifts!!!
Congratulations!!!
Top 5 Contributors of the Month
satyapriyanayak
Narayanan
Thamilselvan J
Anna Harris
Eone James
Home
>>
Forum
>>
Sql Server
>>
Post New Question
Subscribe to Forum
How to read XML structure in SQL Server
Posted By:
Mahesh
Posted Date:
June 21, 2012
Points:
5
Category :
Sql Server
How to read XML structure in SQL Server
Responses
Author:
Mahesh
Company URL:
http://www.dotnetspark.com
Posted Date: June 21, 2012 Points: 20
DECLARE @xml XML
SET @xml = (SELECT id, fname, lname FROM customers WHERE id in (161,162) FOR XML PATH('customers'))
SELECT
x.d.value('id[1]','INT') AS id,
x.d.value('fname[1]','VARCHAR(50)') AS fname,
x.d.value('lname[1]','VARCHAR(50)') AS lname
FROM @xml.nodes('/customers') x(d)
Post Reply
You must
Sign In
To post reply
Related Questions Related Questions
Read data from xml using sql server
read a node from xml using sql server
How to copy a file from server to local system
To save image in the SQL server.
Image store in Database SQL SERVER
Latest Forum Questions From The Same Category
Materialization views
Split function for String in SQL Server
how to solve error in the storeprocedure
convert nvarchar sql server data type to number in ssis
while updating table...the old data should be save in another table
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Here
Quick Links For Forum Categories:
ASP.Net
Windows Application
.NET Framework
C#
VB.Net
ADO.Net
Sql Server
SharePoint
OOPs
Silverlight
IIS
JQuery
JavaScript/VBScript
Biztalk
WPF
Patten/Practices
WCF
Others
www.DotNetSpark.com
UnAnswered
All
Hall of Fame
Twitter
Terms of Service
Privacy Policy
Contact Us
Archives
Tell A Friend