Logo 
Search:

C# Answers

Ask Question   UnAnswered
Home » Forum » C#       RSS Feeds
  Question Asked By: Jayden Brown   on Jul 07 In C# Category.

  
Question Answered By: Freya Brown   on Jul 07

To retrive values  Employee Code & Name from xml...

Declare @tempEmp xml
set @tempEmp='<Root>
<Employee Code="1">
<Name>Tim</Name>
</Employee>
<Employee Code="2">
<Name>Jimmy</Name>
</Employee>
</Root>'

SELECT T.c.value('@Code','int'),T.c.value('Name[1]','VarChar(100)')
FROM @tempEmp.nodes('/Root/Employee') T(c)

Share: 

 
 


Tagged: