From: balgovindjss@gmail.com   
      
   On Monday, February 10, 2014 3:50:41 PM UTC+5:30, giancarlo....@gmail.com   
   wrote:   
   > Hi everybody. My XML file is:   
   >   
   >    
   >   
   > 001   
   >   
   > CSTNDA69P90H523R   
   >   
   >    
   >   
   > CAST   
   >   
   > NADIR   
   >   
   > F   
   >   
   > 10091979   
   >   
   > RONCA   
   >   
   > BL   
   >   
   >    
   >   
   >    
   >   
   >    
   >   
   > 002   
   >   
   > PRSGRI74L29F443L   
   >   
   >    
   >   
   > PERISSI   
   >   
   > IGOR   
   >   
   > M   
   >   
   > 29071970   
   >   
   > MONTE   
   >   
   > SA   
   >   
   >    
   >   
   >    
   >   
   >   
   >   
   > I need to get in ONE RECORD, both node value and his child nodes values,   
   like this   
   >   
   > 001 | CSTNDA69P90H523R | CAST | NADIR | F | 10091979 | RONCA | BL   
   >   
   > 002 | PRSGRI74L29F443L | PERISSI | IGOR | M | 29071970 | MONTE | SA   
   >   
   > ....   
   >   
   >   
   >   
   > With this:   
   >   
   > SELECT   
   >   
   > X.valore.query('NumeroProgressivo').value('.', 'VARCHAR(20)') as   
   NumeroProgressivo,   
   >   
   > X.valore.query('CodiceFiscale').value('.', 'VARCHAR(16)') as CodiceFiscale   
   >   
   >   
   >   
   > FROM Tbulk   
   >   
   > CROSS APPLY Tbulk.nodes('Fornitura/Documento/Soggetti/PrimoModulo/Locatore')   
   AS X(valore);   
   >   
   >   
   >   
   > I only get the first node values (NumeroProgressivo, CodiceFiscale), but not   
   the child nodes (cognome, nome sesso...)   
      
      
   You can do it using OpenXML query that is an easy approach i think :)   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|