Using XQuery in SQL Server

blackimpallass

New Member
My table contains 2 columns, one is the \[code\]Id\[/code\] of type \[code\]int\[/code\] and the other is of type \[code\]Xml\[/code\]. In the \[code\]Xml\[/code\] column, I have data of this structure \[code\]<Fields> <Field name='aa' value='http://stackoverflow.com/questions/11069929/000'/> <Field name='bb' value='http://stackoverflow.com/questions/11069929/111'/> <Field name='cc' value='http://stackoverflow.com/questions/11069929/222'/></Fields>\[/code\]Now using XQuery, I want to query the table to get all rows where field tag with name attribute is \[code\]aa\[/code\] and value attribute is \[code\]111\[/code\], AND field tag with name is attribute \[code\]bb\[/code\] and value attribute is \[code\]222\[/code\]. In other words I want to supply the name / value pair and get rows where the xml data match. Thank you !
 
Back
Top