Code Monkey home page Code Monkey logo

smwika / load-complex-xml-to-sql-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from msornakumar/load-complex-xml-to-sql-server

0.0 1.0 0.0 30 KB

This generic SSIS script code loads any complex XML data into SQL Server Database. The table structure based on the XML structure is created dynamically and the data is loaded. There is an option of making this to work as Framework with Framework tables to store the File details and load the relationship between the tables in the XML File. The script loops through the XML files provided in the path and loads the data into the SQL Server database. All these values are configurable.

load-complex-xml-to-sql-server's Introduction

Load Complex XML data to SQL Server

This generic SSIS script code loads any complex XML data into SQL Server Database. The table structure based on the XML structure is created dynamically and the data is loaded. There is an option of making this to work as Framework with Framework tables to store the File details and load the relationship between the tables in the XML File. The script loops through the XML files provided in the path and loads the data into the SQL Server database. All these values are configurable.

How it works

Configure the variables with the required values and run the SSIS package. Refer to the variables section for the details on the variables.

Setup & Run

Compile the objects from the Code\Script folder in the database in which files to be loaded. This is required only if Framework variable to be set to TRUE. Open the solution in Visual Studio 2015 & run

SSIS Variables

  • XMLFilePath - Path from which XML Files will be read.

  • XMLFileSpec - File specification like *.XML.

  • XMLSQLServer - SQL SERVER in which data to be loaded.

  • XMLSQLDatabase - SQL Server Database in which data to be loaded.

  • XMLTablePrefix - Based on the tables in the XML files , Tables will be created with this prefix.

  • XMLFrameWork - When chosen TRUE , Works with the framework table in which the file details will be stored and the relationship between the XML table also stored. To use this the objects from the script folder needs to be created in the database in which the data to be loaded. When chosen FALSE , the tables only will be created and loaded. No need to compile the objects from the script table.

Framework Objects

  • XMLFileMaster - This table stores the processed file name , path and processed date time. Generate a unique FileID for each files processed.

  • XMLTableRelationship - This table stores the relationship between the XML tables with in a file.

  • XMLErrorLog - The script task generates the INSERT statement internally. In case of error , this table will have the details of the error with the insert statement. This will be help full debugging.

  • GenerateXMLFileID - This is a stored procedure used to generate the file Ids.

Prerequisite

  • Visual Studio 2015
  • SSDT for 2015
  • SQL Server 2012 & above.
Change the Target Version in the Visual Studio based on the need.

load-complex-xml-to-sql-server's People

Contributors

msornakumar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.