TSQL where on xml data type

koudanshi

New Member
How does one execute where clause command on a xml data type in Sql Server 2005 ?Xml Structure\[code\]<User UserId="1" UserName="x"><User UserId="2" UserName="y">\[/code\]Query\[code\]SELECT XmlColumn from Table where XmlColumn.query('/User[@UserId'+ @dynamicValue +']')\[/code\]Intended OutputGet all the user tags where the attribute UserId = input variable
 
Back
Top