Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Output query in XML

Author  Topic 

bogey
Posting Yak Master

166 Posts

Posted - 2009-11-11 : 10:47:36
We are working on a project that sends data to the government for stimulus reporting. All of our tables are built and data is there but we need to send specific xml files as shown below. Any clue as how to output the data into this? Thanks.

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2009 sp1 (http://www.altova.com)-->
<recoveryrr:GrantLoanReport xsi:schemaLocation="urn:us:gov:recoveryrr recoveryrr-xc.xsd" xmlns:nc="http://niem.gov/niem/niem-core/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:recoveryrr="urn:us:gov:recoveryrr" xmlns:recoveryrr-ext="urn:us:gov:recoveryrr-ext">
<recoveryrr-ext:GrantLoanReportHeader>
<recoveryrr-ext:PrimeRecipientDUNS>aaaaaaaaa</recoveryrr-ext:PrimeRecipientDUNS>
<recoveryrr-ext:AwardIdNumber>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</recoveryrr-ext:AwardIdNumber>
<recoveryrr-ext:GrantLoanAwardCategory>Federally Awarded Contract</recoveryrr-ext:GrantLoanAwardCategory>
</recoveryrr-ext:GrantLoanReportHeader>
<recoveryrr-ext:GrantLoanPrimeRecipientReport>
<recoveryrr-ext:GrantLoanAwardDetail>
<recoveryrr-ext:FundingAgencyCode>0500</recoveryrr-ext:FundingAgencyCode>
<recoveryrr-ext:AwardingAgencyCode>0500</recoveryrr-ext:AwardingAgencyCode>
<recoveryrr-ext:FinalReportIndicator>N</recoveryrr-ext:FinalReportIndicator>
<recoveryrr-ext:CompleteTreasuryAccountSymbol>
<recoveryrr-ext:TreasuryAccountSymbol>05-0108</recoveryrr-ext:TreasuryAccountSymbol>
<recoveryrr-ext:SubAccountCode>aaa</recoveryrr-ext:SubAccountCode>
</recoveryrr-ext:CompleteTreasuryAccountSymbol>
<recoveryrr-ext:AwardDate>1967-08-13</recoveryrr-ext:AwardDate>

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-11-11 : 10:49:24
this is possible but show us the tables you are trying to extract this from, their structure and some sample data. otherwise you ain't get no stimulus :)

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -