views:

24

answers:

2


  
  


--- This is the content of the XML file or consider as XML variable.

From above xml file , i want the data like ..


id name             desc         parentid 
1  serach           Search       NULL
2  Search By Name   SearchName   1
3  Search By ID     SearchID     1


How can we get with single SQL statement in SQL server 2005? because i have so many sql file need to be imported into table from file as same way.

Thanks,

A: 

until you provide more info http://www.simple-talk.com/sql/t-sql-programming/beginning-sql-server-2005-xml-programming/ may be helpful

Aamod Thakur
A: 

have you tried something like this declare @xml xml set @xml = ' ' select t.c.value('./@Header','Char(100)') from @xml.nodes('/t1/RadMenuItem') t(c)

You can expand it further...

We have detailed some XML query stuff at http://www.abhyast.com/abhyastcom/post/NESTED-FOR-XML-Queries-with-SQL-Server.aspx

If it does not suffice you let me know I would help you in writing this query.

bgcharan