I need to feed periodically specific format xml with data which I can get from SQL Server 2012. What is the proper or more efficient way of doing this to automate the task as much as possible? I can select from SQL Database all data (values for the tags) but is it possible to save them in specific XML format and generate the whole file from the query? Or rather I need to inject the data into that external file. The xml file for one client looks like this:
<?xml version="1.0"?>
<AddCases>
<AddCase>
<Case>
<Debtor>
<Consumer>
<FirstName>John</FirstName>
<Surname>Doe</Surname>
<Citizenship>Mars</Citizenship>
<Birthday>1979-08-31</Birthday>
<SSN>79083102949</SSN>
<Address>
<Street>135 Main St</Street>
<City>Linden</City>
<ZipCode>5556</ZipCode>
<Country>US</Country>
</Address>
<Sex>men</Sex>
</Consumer>
</Debtor>
<History>
<InformationDate>2014-01-02</InformationDate>
<PaymentStatusCode>00</PaymentStatusCode>
<OverDue>0</OverDue>
<OverdueAmount>0</OverdueAmount>
<DueAmount>42000</DueAmount>
</History>
.
.
.
<SourceSymbol>pap</SourceSymbol>
</Consent>
</Consents>
</CreditAccount>
</CreditAccouts>
</Case>
</AddCase>