Reading INI file array in DTS

Posted on 2006-03-28
Last Modified: 2013-11-30
I've got an INI file with data similar to the following:


I need to be able to read this through DTS, and at times the number of items in the array will change.  Does anyone know how to do this?
Question by:khooc
    LVL 75

    Accepted Solution

    >>and at times the number of items in the array will change<<
    I am afraid to tell you that there is no concept of arrays in INI files.  As far as the INI is concerned it is not an array, just a list of items that happen to have [] brackets.  DTS will treat them exactly the same way.  In other words you can associate one Global Variable to one item.  So if the number of items is variable you may be SOL.

    The only workaround, that I can think of is to use an ActiveX Script Task to read in the elements into a table.  But that defeats the whole object of using an INI file in the first place...

    A better approach would be to convert the INI to an Xml document and pass that into a Stored Procedure where you can then shred it with OPENXML.

    Author Comment

    Hrmm... the requirements are already signed off, and I think the client really likes the INI idea.

    oh well, time to hit the script!

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
    Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now