Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Read XML Tags using SQL Select Query

$
0
0

Hi All

I am having the XML as below

<University>
   <RegistrationCode>12859</RegistrationCode>
   <Colleges>
      <College>
          <CollegeCode>0001</CollegeCode>
          <CollegeName>NIMS</CollegeName>
      </College>
      <College>
         <CollegeCode>0002</CollegeCode>
         <CollegeName>OXFORD</CollegeName>
      </College>
   </Colleges>
</University>

From the above XML i need a SQL query to read the nodes of XML and output should be as follows:

RegistrationCode     CollegeCode          CollegeName

12859                      0001                      NIMS

12859                      0002                      OXFORD


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>