title: Read XML Root values into Table
body: <p>I am working with XML files to save into a database table. </p>
  
  <p>This is my XML:   </p>
  
  <pre><code>     &lt;?xml version="1.0"encoding="UTF-8"standalone="true"?&gt;
  &lt;Computer Name="WH7"Processior="Intel(R) Core(TM)2 Duo CPU     P9600  @ 2.66GHz" Manufacturer="Dell Inc." Model="Latitude E6500 Domain="WORKGROUP" RAM="3536 MB" ServiceTag="DGQKTJ1"&gt;
      &lt;BIOS Manufacturer="Dell Inc." Version="Phoenix ROM BIOS PLUS Version 1.10 A19"/&gt;   These properties go into the Asset table
      &lt;OS Name="Microsoft Windows 7 Ultimate" ServicePack="1"/&gt;   OS - Category, Namem, Service Pack - Property, 
      &lt;HardDisks&gt; HardDisks - Category, Value - Save as Name in the Property table
          &lt;HardDisk Value=C:\ (NTFS) Total Space: 127.8373 GB Free Space: 16.2686 GB/&gt;
      &lt;/HardDisks&gt;
      &lt;NetworkCards&gt;  NaetworkCards - Category, Adapter, IPAddress, Subnet Mask, MACAddress, DHCPEnable as properties
          &lt;Network Adapter="[00000007] Intel(R) 82567LM Gigabit Network Connection" IPAddress="10.5.99.48" Subnet Mask="255.255.255.0" MACAddress="00:21:70:F7:C9:A2" DHCPEnabled="True"/&gt;
          &lt;Network Adapter="[00000009] VMware Virtual Ethernet Adapter for VMnet1" IPAddress="192.168.216.1" Subnet Mask="255.255.255.0" MACAddress="00:50:56:C0:00:01" DHCPEnabled="False"/&gt;
          &lt;Network Adapter="[00000012] Dell Wireless 1397 WLAN Mini-Card" IPAddress="192.168.1.64" Subnet Mask="255.255.255.0" MACAddress="00:24:2C:63:F5:08" DHCPEnabled="True"/&gt;
          &lt;Network Adapter="[00000013] VMware Virtual Ethernet Adapter for VMnet8" IPAddress="192.168.202.1" Subnet Mask="255.255.255.0" MACAddress="00:50:56:C0:00:08" DHCPEnabled="False"/&gt;
          &lt;Network Adapter="[00000020] Cisco Systems VPN Adapter" IPAddress="172.31.3.251" Subnet Mask="255.255.252.0" MACAddress="00:05:9A:3C:78:00" DHCPEnabled="False"/&gt;
      &lt;/NetworkCards&gt;
      &lt;GraphicsCards&gt; GraphicsCards - Category, Card - Property
          &lt;Graphics Card="Current Display Controller Configuration"/&gt;
      &lt;/GraphicsCards&gt;
      &lt;LocalGroups&gt;   
          &lt;Group Name="Administrators"&gt; LocalGroups - Category, Name - Property
              &lt;Member="Administrator"/&gt; Member - Category, Administrator, whargrove - Property, Administrators - Parent
              &lt;Member="whargrove"/&gt;
          &lt;/Group&gt;
          &lt;Group Name="Backup Operators"&gt;
          &lt;/Group&gt;
          &lt;Group Name="Cryptographic Operators"&gt;
          &lt;/Group&gt;
          &lt;Group Name="Distributed COM Users"&gt;
          &lt;/Group&gt;
          &lt;Group Name="Event Log Readers"&gt;
          &lt;/Group&gt;
          &lt;Group Name="Guests"&gt;
              &lt;Member="Guest"/&gt;
          &lt;/Group&gt;
          &lt;Group Name="IIS_IUSRS"&gt; LocalGroups - Category, IIS_USERS - Property
              &lt;Member="IUSR"/&gt; LocalGroups - Member, IUSER - Property, IIS_USERS - Parent
          &lt;/Group&gt;
          &lt;Group Name="Network Configuration Operators"&gt;
          &lt;/Group&gt;
          &lt;Group Name="Performance Log Users"&gt;
          &lt;/Group&gt;
          &lt;Group Name="Performance Monitor Users"&gt;
          &lt;/Group&gt;
          &lt;Group Name="Power Users"&gt;
          &lt;/Group&gt;
          &lt;Group Name="Remote Desktop Users"&gt;
          &lt;/Group&gt;
          &lt;Group Name="Replicator"&gt;
          &lt;/Group&gt;
          &lt;Group Name="Users"&gt;
              &lt;Member="INTERACTIVE"/&gt;
              &lt;Member="Authenticated Users"/&gt;
              &lt;Member="IPS_admin"/&gt;
          &lt;/Group&gt;
          &lt;Group Name="boinc_admins"&gt;
              &lt;Member="Administrators"/&gt;
              &lt;Member="whargrove"/&gt;
          &lt;/Group&gt;
          &lt;Group Name="boinc_projects"&gt;
          &lt;/Group&gt;
          &lt;Group Name="boinc_users"&gt;
          &lt;/Group&gt;
          &lt;Group Name="HomeUsers"&gt;
              &lt;Member="whargrove"/&gt;
              &lt;Member="Administrator"/&gt;
              &lt;Member="HomeGroupUser$"/&gt;
          &lt;/Group&gt;
          &lt;Group Name="__vmware__"&gt;
              &lt;Member="__vmware_user__"/&gt;
          &lt;/Group&gt;
      &lt;/LocalGroups&gt;
      &lt;SoftwareInstalled&gt; SoftwareInstalled - Category, ProductName, VersionString, InstallLocation, InstallSource, InstallDate, Publisher, LocalPackage - Property
          &lt;ProductName="VMware Infrastructure Update" VersionString="2.5.0.64237" InstallLocation="C:\Program Files\VMware\Infrastructure\" InstallSource="C:\Users\WHARGR~1\AppData\Local\Temp\_isA1FB\" InstallDate="20110721" Publisher="VMware, Inc." LocalPackage="C:\Windows\Installer\7124493c.msi"/&gt;
          &lt;ProductName="NT Testing TCP Tool" VersionString="1.0.0" InstallSource="C:\Users\whargrove\Downloads\" InstallDate="20130211" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\20788d8c.msi"/&gt;
          &lt;ProductName="inSSIDer" VersionString="2.1.3" InstallSource="C:\Users\whargrove\Downloads\" InstallDate="20120605" Publisher="MetaGeek" LocalPackage="C:\Windows\Installer\8eb9c024.msi"/&gt;
          &lt;ProductName="MessageOps Exporter" VersionString="1.20" InstallSource="C:\Users\whargrove\AppData\Local\Temp\Temp1_MOExport1.2.zip\" InstallDate="20130409" Publisher="MessageOps" LocalPackage="C:\Windows\Installer\55a29199.msi"/&gt;
          &lt;ProductName="Aventail Access Manager" VersionString="10.53.52" InstallSource="C:\Users\WHARGR~1\AppData\Local\Temp\" InstallDate="20111214" Publisher="SonicWALL Inc" LocalPackage="C:\Windows\Installer\5139fce3.msi"/&gt;
          &lt;ProductName="HumanConcepts OrgPlus 8 Plug-in" VersionString="8.3.1195.0" InstallLocation="C:\Program Files\Common Files\HumanConcepts\OrgPlus 8 Plug-in\" InstallSource="C:\Users\WHARGR~1\AppData\Local\Temp\{5AB92F13-75A0-4FCC-90FA-AC9F078CA828}\" InstallDate="20110506" Publisher="HumanConcepts" LocalPackage="C:\Windows\Installer\7f0e109.msi"/&gt;
          &lt;ProductName="Google Talk Plugin" VersionString="4.1.3.13728" InstallSource="C:\Users\whargrove\AppData\Local\Google\Update\Install\{BAF66C66-BE24-43FD-BA71-1652286B168A}\" InstallDate="20130627" Publisher="Google" LocalPackage="C:\Windows\Installer\4ec819ea.msi"/&gt;
          &lt;ProductName="Microsoft Office Visio MUI (English) 2007" VersionString="12.0.6612.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90120000-0054-0409-0000-0000000FF1CE}-C\" InstallDate="20111108" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\32a4511.msi"/&gt;
          &lt;ProductName="Microsoft Office Shared Setup Metadata MUI (English) 2007" VersionString="12.0.6612.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90120000-0115-0409-0000-0000000FF1CE}-C\" InstallDate="20111108" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\ad65c.msi"/&gt;
          &lt;ProductName="Microsoft Office Proofing (English) 2007" VersionString="12.0.4518.1014" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90120000-002C-0409-0000-0000000FF1CE}-C\" InstallDate="20100223" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\ad69a.msi"/&gt;
          &lt;ProductName="Microsoft Office Shared MUI (English) 2007" VersionString="12.0.6612.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90120000-0115-0409-0000-0000000FF1CE}-C\" InstallDate="20111108" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\ad656.msi"/&gt;
          &lt;ProductName="Microsoft Office Proof (English) 2007" VersionString="12.0.6612.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90120000-002C-0409-0000-0000000FF1CE}-C\Proof.en\" InstallDate="20111108" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\ad694.msi"/&gt;
          &lt;ProductName="Microsoft Office Proof (Spanish) 2007" VersionString="12.0.6612.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90120000-002C-0409-0000-0000000FF1CE}-C\Proof.es\" InstallDate="20111108" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\ad686.msi"/&gt;
          &lt;ProductName="Microsoft Office Proof (French) 2007" VersionString="12.0.6612.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90120000-002C-0409-0000-0000000FF1CE}-C\Proof.fr\" InstallDate="20111108" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\ad68d.msi"/&gt;
          &lt;ProductName="Microsoft Office Visio Professional 2007" VersionString="12.0.6612.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{91120000-0051-0000-0000-0000000FF1CE}-C\" InstallDate="20130701" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\32a454d.msi"/&gt;
          &lt;ProductName="Microsoft Application Error Reporting" VersionString="12.0.6012.5000" InstallSource="C:\Program Files\Common Files\Windows Live\.cache\ce1168531ccf8a006\" InstallDate="20120302" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\bdfec60a.msi"/&gt;
          &lt;ProductName="Microsoft Office Professional Plus 2010" VersionString="14.0.6029.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90140000-0011-0000-0000-0000000FF1CE}-C\" InstallDate="20130701" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\2174b34.msi"/&gt;
          &lt;ProductName="Microsoft Office OneNote MUI (English) 2010" VersionString="14.0.6029.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90140000-00A1-0409-0000-0000000FF1CE}-C\" InstallDate="20111108" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\2c0e4c29.msi"/&gt;
          &lt;ProductName="Microsoft Office InfoPath MUI (English) 2010" VersionString="14.0.6029.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90140000-0044-0409-0000-0000000FF1CE}-C\" InstallDate="20110726" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\2173ff1.msi"/&gt;
          &lt;ProductName="Microsoft Office Access MUI (English) 2010" VersionString="14.0.6029.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90140000-0117-0409-0000-0000000FF1CE}-C\Access.en-us\" InstallDate="20110726" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\2c0e4c33.msi"/&gt;
          &lt;ProductName="Microsoft Office Shared Setup Metadata MUI (English) 2010" VersionString="14.0.6029.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90140000-0115-0409-0000-0000000FF1CE}-C\" InstallDate="20110726" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\2c0e4bfc.msi"/&gt;
          &lt;ProductName="Microsoft Office Excel MUI (English) 2010" VersionString="14.0.6029.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90140000-0016-0409-0000-0000000FF1CE}-C\" InstallDate="20110726" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\2c0e4c09.msi"/&gt;
          &lt;ProductName="Microsoft Office Access Setup Metadata MUI (English) 2010" VersionString="14.0.6029.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90140000-0117-0409-0000-0000000FF1CE}-C\" InstallDate="20110726" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\2c0e4c38.msi"/&gt;
          &lt;ProductName="Microsoft Office PowerPoint MUI (English) 2010" VersionString="14.0.6029.1000" InstallLocation="C:\Program Files\Microsoft Office\" InstallSource="C:\MSOCache\All Users\{90140000-0018-0409-0000-0000000FF1CE}-C\" InstallDate="20110726" Publisher="Microsoft Corporation" LocalPackage="C:\Windows\Installer\2c0e4c03.msi"/&gt;
  
      &lt;/SoftwareInstalled&gt;
  &lt;/Computer&gt;
  </code></pre>
  
  <p>And my database table's columns are </p>
  
  <pre><code>ID       Category    Property Value Parent
  </code></pre>
  
  <p>T-SQL create script for my table: </p>
  
  <pre><code>Create table AssetProperty
  (
  Id  int IDENTITY(100001, 1) NOT NULL,
  Category varchar(120),
  Property varchar(100),
  Value varchar (max),
  Parent varchar(50)
  )
  </code></pre>
  
  <p>I want save above xml data into this table. </p>
  
  <p>From the xml file OS needs to go into "Category" column and Name needs to go into "property" column and Name value should go into "Value" column and Parent should be "Administrators" from</p>
  
  <pre><code>&lt;LocalGroups&gt;   
              &lt;Group Name="Administrators"&gt;.
  </code></pre>
  
  <p>How would I achieve this?</p>