Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5989477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:06:24+00:00 2026-05-22T23:06:24+00:00

I am using SSIS in Visual Studio 2008. I have many XML files that

  • 0

I am using SSIS in Visual Studio 2008. I have many XML files that I need to process and place into an existing DB structure (SQL Server 2005). This is my first attempt at using SSIS and am a little stuck. I have found the XML Data Flow task, assigned it a test xml file and it’s associated XSD, and mapped one node to a Database Table. My question is, how do I associate many xsd nodes with many tables? Surely I don’t have to set up an XML source for each table?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:06:25+00:00Added an answer on May 22, 2026 at 11:06 pm

    Here is a possible option which demonstrates how to load multiple XML files having same definition into an SQL Server table. The example uses SQL Server 2008 R2 and SSIS 2008 R2. The example shown here loads three XML files into an SQL table using SSIS Data Flow Task with the help of XML Source component.

    Step-by-step process:

    1. Create a table named dbo.Items using the script given under SQL Scripts section.
    2. Create an XSD file named Items.xsd in the folder path C:\temp\xsd using the content provided under XSD File section.
    3. Create three XML files namely Items_1.xml, Items_2.xml and Items_3.xml in the folder path C:\temp\xml using the content provided under XML Files section.
    4. On the package, create 3 variables namely FileExtension, FilePath and FolderPath as shown in screenshot #1.
    5. On the package’s Connection Managers, create an OLE DB Connection named SQLServer to connect to the SQL Server Instance as shown in screenshot #2.
    6. On the Control Flow tab, place a Foreach loop container and a Data Flow Task within the Foreach loop container as shown in screenshot #3.
    7. Configure the Foreach Loop container as shown in screenshots #4 and #5.
    8. Double-click on the Data Flow Task to navigate to the Data Flow tab. Place an XML Source component and an OLE DB Destination as shown in screenshot #6.
    9. Configure the XML Source as shown in screenshot #7 and #8. The XML file path will be retrieved from the variable FilePath. This variable will be populated by the Foreach Loop container.
    10. Configure the OLE DB Destination as shown in screenshots #9 and #10.
    11. Screenshots #11 and #12 show the package execution.
    12. Screenshot #13 shows the table data before the package execution. Screenshot #14 shows the table data after the package execution. The data in the table dbo.Items now contains the data present in three XML files.

    Hope that helps.

    SQL Scripts:

    CREATE TABLE [dbo].[Items](
        [Id] [int] IDENTITY(1,1) NOT NULL,
        [ItemNumber] [nvarchar](50) NOT NULL,
        [ItemName] [nvarchar](60) NOT NULL,
        [Price] [numeric](18, 2) NOT NULL,
    CONSTRAINT [PK_Items] PRIMARY KEY CLUSTERED ([Id] ASC)) ON [PRIMARY]
    GO
    

    XSD File

    <xsd:schema xmlns:schema="ItemsXSDSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sqltypes="http://schemas.microsoft.com/sqlserver/2004/sqltypes" targetNamespace="ItemsXSDSchema" elementFormDefault="qualified">
        <xsd:import namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes" schemaLocation="http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd" />
        <xsd:element name="Items">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element minOccurs="0" maxOccurs="unbounded" name="Item">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="Id" type="sqltypes:int" />
                                <xsd:element name="ItemNumber">
                                    <xsd:simpleType>
                                        <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
                                            <xsd:maxLength value="20" />
                                        </xsd:restriction>
                                    </xsd:simpleType>
                                </xsd:element>
                                <xsd:element name="ItemName">
                                    <xsd:simpleType>
                                        <xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
                                            <xsd:maxLength value="60" />
                                        </xsd:restriction>
                                    </xsd:simpleType>
                                </xsd:element>
                                <xsd:element name="Price">
                                    <xsd:simpleType>
                                        <xsd:restriction base="sqltypes:numeric">
                                            <xsd:totalDigits value="18" />
                                            <xsd:fractionDigits value="2" />
                                        </xsd:restriction>
                                    </xsd:simpleType>
                                </xsd:element>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>
    

    XML Files

    Items_1.xml

    <?xml version="1.0"?>
    <Items xmlns="ItemsXSDSchema">  
        <Item>
            <Id>1</Id>
            <ItemNumber>I2345343</ItemNumber>
            <ItemName>Monitor</ItemName>
            <Price>299.99</Price>
        </Item>
    </Items>
    

    Items_2.xml

    <?xml version="1.0"?>
    <Items xmlns="ItemsXSDSchema">  
        <Item>
            <Id>1</Id>
            <ItemNumber>J1231231</ItemNumber>
            <ItemName>Mouse</ItemName>
            <Price>29.99</Price>
        </Item>
    </Items>
    

    Items_3.xml

    <?xml version="1.0"?>
    <Items xmlns="ItemsXSDSchema">  
        <Item>
            <Id>1</Id>
            <ItemNumber>K0456212</ItemNumber>
            <ItemName>Keyboard</ItemName>
            <Price>49.99</Price>
        </Item>
    </Items>
    

    Screenshot #1:

    1

    Screenshot #2:

    2

    Screenshot #3:

    3

    Screenshot #4:

    4

    Screenshot #5:

    5

    Screenshot #6:

    6

    Screenshot #7:

    7

    Screenshot #8:

    8

    Screenshot #9:

    9

    Screenshot #10:

    10

    Screenshot #11:

    11

    Screenshot #12:

    12

    Screenshot #13:

    13

    Screenshot #14:

    13

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using SQL Server 2005 and Visual Studio 2005, I'm trying to create a SSIS
I need to convert a flat file to DB using MS SSIS. I need
when calling a SSIS package (C# app) using LoadFromSqlServer, does the user account have
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I have made a SSIS package to create an XML file, which works fine
Is using SSIS to do reformatting of flat files from one format to another
I'm using SSIS to import data from Excel sheets into SQL Server 2005, the
I have XML (see below). I need to insert the records in this XML
I would like to Download Email attachment using SSIS.If possible,Please describe the process.
I have this URL where there is XML data. I have to extract that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.