Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
HiI want to search an XML column and return rows where the XML field contains the tag <Item Tr="12"> - what would be the easiest/best way to do this?Many thanks in advance
James K
Master Smack Fu Yak Hacker
3873 Posts
Posted - 2013-04-17 : 08:50:02
Probably the exist() method. See here for documentation and examples: http://msdn.microsoft.com/en-us/library/ms189869.aspx
next235
Starting Member
2 Posts
Posted - 2013-04-17 : 09:32:46
excuse me for being daft, but is there any chance you could give me a simple example? Basically I have a table which includes the colums DEFINITION which contains an XML definition and NAME, and I wish to return NAMES where the DEFINITION XML column contains <Item Tr="12">.Thanks.