extracting xml value in sproc

TogginoIgnivy

New Member
Assuming I have the following XML:\[code\]<root><test1>Hello</test1><test2>World</test2></root>\[/code\]and in my stored procedure I have declared a variable like this:\[code\]DECLARE @Stuff nvarchar(50)\[/code\]If the XML is passed into the stored procedure as\[code\]@MyXml\[/code\]What would be the statement to parse the incoming XML to get the value held in element \[code\]test1\[/code\]?I am using SQL Server 2008
 
Back
Top