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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 using exist function to see if there is a match

Author  Topic 

ATG
Starting Member

35 Posts

Posted - 2011-12-13 : 00:37:04
I'm learning XML queries with SQL.

Lets say we have a table called 'book' and a column 'subject'

I want to filter something along the lines of:

datax.exist('(//book/subject="Fiction"')=1

This is incorrect, but I know I'm close...

Thanks


visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-13 : 01:00:46
it should be

datax.exist('//book[subject="Fiction"]')=1



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -