Data Transfer from XML file to Database by using XSD format
Introduction:-
In this scenario we are transferring data from XML file to database by using XML Schema Definition.
We are not covering the creation of XSD file in this scenario.

3. RIght click in the Local Object Library area & select "New".
Window for creating new datastore will open.

GIve all the details.
DataStore Name:- any name you want to give.
DataStore Type:- Database.
Database Type:- here we are using Microsoft SQL Server
Database version:- Microsoft SQL Server 2008
Database Server Name:- server name
User name & Password:- Details about User name & password.
4. Click "OK" & the Datastore will be created & can be seen in the Local Object Library.

We are creating xsd file for the following type of xml file.

XSD file created for the above xml file is as follows.

1. Creating XML Schema File Format.
Give all required details.

Format Name:- name of the file format(any name)
File Name:- full path of the xsd file.
Root Element Name:- Root element name of the xml file(here it is Employee)

1. Create Project
2. Create a Batch Job.
3.Add a dataflow into the job.

4. Build the scenario in the dataflow.

Double click on File Format & provide the name of the source xml file.
Enable Validation to validate the xml file with provided XSD format.


5. Open the query & do Mapping.


We are un nesting the nodes because we don't want them to be made available at the target side.


6. Inserting target table.
We can either import the already created table or we can use template table which afterwards will actually be created in the database.
We are using template table here.


7. Save the Job & Validate it.


8. Execute the job.
9. Check the output in the table.

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 3143 | |
| 1916 | |
| 1916 | |
| 1213 | |
| 1081 | |
| 757 | |
| 755 | |
| 742 |