Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

convert table to XML

$
0
0

Hi

I'm having the following table

DBType                                                                                               DBServer                 FODB DBName

System Administrator Historical Database            CCLAB602BI\TENANTDB  NULL SystemAdministrator

Tenant Historical Database                     CCLAB602BI\TENANTDB  NULL DefaultTenant

Media Recording Database                       CCLAB602BI\TENANTDB  NULL CosmoMedia

Tenant Data Warehouse Database                         CCLAB602BI\TENANTDB  NULL TenantDataWarehouse

Tenant OLAP Database                           CCLAB602BI\MSAS      NULL CosmoComOLAPDB

Tenant Historical Database                     CCLAB602BI\TENANTDB  NULL  cclab2Historical

Media Recording Database                       CCLAB602BI\TENANTDB  NULL  cclab2Recording

I would like to create XML where each line will be presented as the following

<NewDataSet>
  <Table>
    <DBType>System Administrator Historical Database</DBType>
    <DBServer>MAURICIO\historicaldb</DBServer>
    <DBFailoverServer />
    <DBName>SystemAdministrator</DBName>
  </Table>
  <Table>
    <DBType>Tenant Historical Database</DBType>
    <DBServer>MAURICIO\historicaldb</DBServer>
    <DBFailoverServer />
    <DBName>DefaultTenant</DBName>
  </Table>
  <Table>
    <DBType>Media Recording Database</DBType>
    <DBServer>MAURICIO\recordingdb</DBServer>
    <DBFailoverServer />
    <DBName>CosmoMedia</DBName>
  </Table>
  <Table>
    <DBType>Tenant Data Warehouse Database</DBType>
    <DBServer>MAURICIO\Historicaldb</DBServer>
    <DBFailoverServer />
    <DBName>TenantDataWarehouse</DBName>
  </Table>
  <Table>
    <DBType>Tenant OLAP Database</DBType>
    <DBServer>MAURICIO\MSAS</DBServer>
    <DBFailoverServer />
    <DBName>CosmoComOLAPDB</DBName>
  </Table>
</NewDataSet>


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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