Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLXML output
Message
From
18/12/2003 13:50:35
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00860405
Message ID:
00860448
Views:
17
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform