Friday, May 23, 2008

Query XML in SQL-2005

Hi friends lets take one look at new feature of SQL-2005 which Supports Query sql Data like relational database. it is rarly used but powerful feature of database.generally this it is not feasible to use XML as relational database but when you have information in which columns are varies frequently in such situation you can Use such feature. and u might know that SQL-2005 have new datatype called xml datatype. Using power of XQuery and XML datatype we fatch data in Tabular format. Declare @XMLFriends xml set @XMLFriends ='hareshParesh'

Select'.','VARCHAR(200)') as FriendId FROM @XMLFriends.nodes('/User/name') as ParamValues(name) Output of above query is: 1 haresh 2 nirav

No comments:

Post a Comment

Comments posted on ASP.Net Ajax Tutorials Blog are moderated and will be approved only if they are on-topic and not abusive. Please email me or my team for tech-support or blogging related questions. Avoid including website URLs in your comments - Thanks Author