Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9
This is the forum to discuss the Wrox book Professional SQL Server 2005 Integration Services by Brian Knight, Allan Mitchell, Darren Green, Douglas Hinson, Kathi Kellenberger, Andy Leonard, Erik Veerman, Jason Gerard, Haidong Ji, Mike Murphy; ISBN: 9780764584350
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 1st, 2008, 09:54 PM
Cha Cha is offline
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Import a XML file into SQL Server tables

I am trying to import a XML file to SQL Sever tables using SSIS Data Flow task --> XML Source (I have a XML file and a XSD file).

The XML file looks like this:

<mc MajCmd="Atlantic">
  <r Region="East">
    <i Installation_UIC="M00146" Installation_Name="MCA Point">
      <bc BC="111" BC_Title="Air Runways">
        <c Restoration_Cost_C3="0.0000" Comment="" />
      </bc>
    </i>
   </r>
</mc>

and the XSD file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="mc">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="r" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="i" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="bc" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="c" minOccurs="0" maxOccurs="unbounded">
                          <xs:complexType>

                          </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="BC" type="xs:string" />
                        <xs:attribute name="BC_Title" type="xs:string" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="Installation_UIC" type="xs:string" />
                  <xs:attribute name="Installation_Name" type="xs:string" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="Region" type="xs:string" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="MajCmd" type="xs:string" />
    </xs:complexType>
  </xs:element>
  <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="mc" />
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>

I created 5 tables (mc, r, i, bc and c)form the extraction of the XML file. My problem is the mc table is empty after the extraction.

Could someone please tell me why this is happening? And how to solve this problem, so I can transfer all the data to SQL tables?

Thanks for your help!

Cha




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to import .MDF file into SQL Server Enterprise shong BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 July 23rd, 2008 11:51 AM
How to import XML into SQL Server dbellavi XML 1 February 26th, 2008 06:02 AM
Import delimited flat file into SQL Server 2000 DevCsharp C# 1 April 27th, 2005 11:52 PM
Import XML and its attribute into SQL server 2000 khautinh C# 0 April 13th, 2005 09:57 AM
import text file to SQL Server DB via DTS pabloron SQL Server 2000 0 July 31st, 2003 06:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.