Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SISSDB - writing custom message

Tags:

database

etl

ssis

I am using SSIS 2012 - project deployment model, utilizing the out of the box SSISDB logging.

However, I was wondering how to log custom messages to the SSISDB, i.e. "hello world" when the package start or when a certain event is raised. Is this possible? Or do I have to fallback to a custom log table, which seems to defeat the advantage of the SSISDB logging.

Thanks!

like image 882
user1832467 Avatar asked Sep 12 '25 07:09

user1832467


1 Answers

Of course it is. What message would you like to log? http://msdn.microsoft.com/en-us/library/ms136054.aspx

This is an example from a Script Task (Control Flow)

        bool fireAgain = false;
        Dts.Events.FireInformation(0, "Test", "I am the description", string.Empty, 0, ref fireAgain);

This is an example from a Script Component (Data Flow)

    bool fireAgain = false;
    ComponentMetaData.FireInformation(0, "Test too", "I am data flow description", string.Empty, 0, ref fireAgain);

You can then look in your reports or write custom queries against catalog.operation_messages in SSISDB. When we were loading our data warehouse, if I found employee ids that the data didn't support, I'd fire off OnInformation events with the words Research in the title and then parse out the bits I needed (employee id and the date).

like image 79
billinkc Avatar answered Sep 14 '25 00:09

billinkc