SSIS ETL Control (Part 2)

After some prompting, I decided it was about time I posted the solution to my initial post on the subject of metadata driven SSIS.

If you have read part one of this series (or other posts related to replication and sql agent), it will come as no surprise to you to know that I am a big proponent of metadata driven control in SQL Server. Whilst more complex to code, it is infinately easier to manage across environments.

I will add further explanations to this package at a later date, but for now, here is the solution and a very brief summary of what it does.

Business Metadata: Capturing Enterprise Knowledge

 

It has 3 elements.

1. There is a control database (which needs to be configured in the parent package), having 5 tables. 4 hold metadata related to the child packages and the final one manages the process flow, and as a by product allows for monitoring of the ETL status. There are also 3 stored procedures which load the queue, update the queue and check for dependencies.

  • dbo.Package
  • dbo.PackageJobs
  • dbo.PackageDependency
  • dbo.Connections
  • dbo.PackageQueue

2. There is an SSIS parent package. The logic in the package is summarized below and simplified somewhat. The best place to get a better understanding is the parent package itself.

  1. Read the PackageQueue
  2. Do I have any records in the queue that indicate there are packages to run?
  3. If so, does it have any dependencies? If it does move on to the next and come back to it later, if not execute the child package.
  4. Have there been any errors. Does the metadata say I should fail the whole batch or should I just fail the package and move on to the next?

3. And finally there is a simple web page. I haven’t got the code to hand on my laptop here in Buenos Aires, however if you wanted to code your own, it is a simple data driven web page that checks the run code in the dbo.PackageQueue table and based on the result, displays the status of all the packages assigning a colour to the record depending on whether its currently running, waiting or failed.

Download the zip file here.

I apologise in advance for the very sparce explanation given, but I promise I will update the post with more detail in the coming weeks. Please leave a comment or send me an email if there is anything specific you want to ask.

Hope you had a good holiday ;-)

Frank

2 Responses to “SSIS ETL Control (Part 2)”

  1. Valek Says:

    Hey Frank. I am definately interested in using something similar to what’s described in this blog message.
    Could you please tell me if it can be used as it is now or you are looking into improving the framework, extending it etc?

    Cheers,
    VAL

  2. FB Says:

    Hi Valek, it definately works as it currently stands as we use it at my clients all be it with a couple of alterations to make it behave as necessary. In particular they needed slightly more flexibility with the variables they were passing to the child packages and the scheduling functionality.

    This being said though, this is only meant as a kick start for those interested to develop around. Its short on scheduling, and a webpage that allows you to control the batches (currently it only monitors)… and probably a few other things too. However, once you see how it works, I’m sure you will have plenty of your own thoughts on how you can improve on it and create one better adapted for your own set up.

    Let me know if you need help getting it working and if you manage to add any functionality to it, I’d be interested to see it.

    Also, I’ve added a readme file to the solution which hopefully explains the solution a little better.

    Cheers
    Frank

Leave a Reply