Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Import data from xml file into SQL Server table

$
0
0

Hi All,

I have an xml file, which i need to load into a SQL Server table.As i never worked with xml files,i need help.

I have below xml in a file, and i need to load this into a table.

Can anyone help writing a sql query to load the below xml into a table.

--------------------------------------------------

<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"><DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"><Version>14.00</Version></DocumentProperties><OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"><AllowPNG/></OfficeDocumentSettings><ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"><WindowHeight>10005</WindowHeight><WindowWidth>10005</WindowWidth><WindowTopX>120</WindowTopX><WindowTopY>135</WindowTopY><ProtectStructure>False</ProtectStructure><ProtectWindows>False</ProtectWindows></ExcelWorkbook><Styles><Style ss:ID="Default" ss:Name="Normal"><Alignment ss:Vertical="Bottom"/><Borders/><Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/><Interior/><NumberFormat/><Protection/></Style></Styles><Worksheet ss:Name="Query Results"><Table ss:ExpandedColumnCount="75" ss:ExpandedRowCount="7319" x:FullColumns="1" x:FullRows="1" ss:DefaultRowHeight="15"><Row><Cell><Data ss:Type="String">Product ID</Data></Cell><Cell><Data ss:Type="String">Product Label</Data></Cell><Cell><Data ss:Type="String">Formulary Status</Data></Cell><Cell><Data ss:Type="String">Formulary Status DESC</Data></Cell><Cell><Data ss:Type="String">Min Age Qualifier</Data></Cell><Cell><Data ss:Type="String">Min Age</Data></Cell></Row><Row><Cell><Data ss:Type="String">00002197590</Data></Cell><Cell><Data ss:Type="String">AXIRON SOL 30MG/ACT</Data></Cell><Cell><Data ss:Type="String">09</Data></Cell><Cell><Data ss:Type="String">NON-FORMULARY</Data></Cell><Cell><Data ss:Type="String"></Data></Cell><Cell><Data ss:Type="String"></Data></Cell></Row></Table><WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"><Selected/><LeftColumnVisible>25</LeftColumnVisible><ProtectObjects>False</ProtectObjects><ProtectScenarios>False</ProtectScenarios></WorksheetOptions></Worksheet></Workbook>



Viewing all articles
Browse latest Browse all 23857

Trending Articles



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