Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

XQUERY In sql server Expand / Collapse
Author
Message
Posted Wednesday, February 13, 2013 12:55 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Sunday, August 17, 2014 11:59 PM
Points: 415, Visits: 1,584
Hi,

I'm very new to XQuery's, here i need a situation to Join two different xml's and apply some filter conditions.
From the below URL we can write the XQuery
[url=http://www.datypic.com/books/xquery/chapter03.html][/url]

But how can we use this in SQL Server.


Post #1419322
Posted Wednesday, February 13, 2013 6:48 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 7:08 PM
Points: 7,097, Visits: 12,599
I am not exactly sure what you're after but if you provide two sample XML documents and your expected results per your thoughts on the filtering and joining requirement you mentioned we can take it from there.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1419480
Posted Wednesday, February 13, 2013 11:44 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Sunday, August 17, 2014 11:59 PM
Points: 415, Visits: 1,584
opc.three (2/13/2013)
I am not exactly sure what you're after but if you provide two sample XML documents and your expected results per your thoughts on the filtering and joining requirement you mentioned we can take it from there.


I have a scenario like, in the table few xml data types, example Location it is having country/State data in xml, all this information is related to user (Userid)
<Location>
<Country Name="India">
<State>HR</State>
<Country Name="UK">
<Country Name="USA">
</Location>

We need to query the above xml based on input xml looks same as above, and one extra parameter is @Operatior = And/Or if we send AND then the user Location xml must contain all the input countries if it is or then if is enough to any one country exist in user table of Location field (xml).

Please provider your inputs on this.


Post #1419825
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse