Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLXML output
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
00860405
Message ID:
00860448
Vues:
16
Nevermine. I just used the "element" directive and all is well. Thanks!


>I have a small new project that requires data from MSSQL to output an XML file over the Internet. I've been playing around with using the SQL Server XML feature but can't quite get it to output the way I need it to.
>
>The output I need would be:
>
<ProjectNo>"12345"
>     <List>
>          <Vendor_cd>"ABC"</Vendor_cd>
>          <Selection_cd>"XY"</Selection_cd>
>          ...
>     </List>
>     <List>
>          <Vendor_cd>"ABC"</Vendor_cd>
>          <Selection_cd>"XY"</Selection_cd>
>          ...
>     </List>
></ProjectNo>
>But so far the best I can get it to output using the FOR XML EXPLICIT claus is:
>
<Project ProjectNo="12345">
>     <List>
>          5559998
>          <Detail Vendor_cd="ABC" Selection_cd="XY"... />
>     </List>
>     <List>
>          5559999
>          <Detail Vendor_cd="DEF" Selection_cd="YZ"... />
>     </List>
>   </ProjectNo>
></Project>
>Two problems:
>1) I can't exclude the List #s w/o loosing the tag set.
>2) I can't get it to include closing tag for each detail item.
>
>As you can tell I'm very new to working with XML and SQLXML in particular. Any help will be greatly appreciated. Thanks.
It's "my" world. You're just living in it.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform