A question about using exist() method against XML column
- From: shawn <overpro@xxxxxx>
- Date: Sat, 15 Mar 2008 20:19:56 +0800
Hi all,
I have a question:
When I execute this query:
select * from Users where MyXmlColumn.exist('/user[@userid = "1000" and @username = "user01"] ') = 1
the result set contains only one row that I expected.
but while I change the query to:
select * from Users where MyXmlColumn.exist('/user[@userid = "1000"] and /user[@username = "user01"] ') = 1
the result set always contains all users.
What's wrong with my 2nd query?
the function exist('/user[@userid = "1000"] and /user[@username = "user01"] ') always return 1 here.
btw, I read "XQuery Against the xml Data Type" of "SqlServer2005 Books Online", but I didn't got some specific details on this.
which section should I read carefully?
Thanks!!
.
- Follow-Ups:
- Re: A question about using exist() method against XML column
- From: Martin Honnen
- Re: A question about using exist() method against XML column
- Prev by Date: Re: XSD Schema Generates Error from SQLXMLBulkLoad 4.0
- Next by Date: Re: A question about using exist() method against XML column
- Previous by thread: XSD Schema Generates Error from SQLXMLBulkLoad 4.0
- Next by thread: Re: A question about using exist() method against XML column
- Index(es):
Relevant Pages
|