

To resolve that, I change the initial values in the package to -1. The OnVariableValueChanged event fires only when the value actually changes! Overwriting with the same value doesn’t fulfill this condition. So there was no change in variable value. The row count of a brand new empty table is also zero. The reason is that the initial value of the variable is set to zero in the package. I see the OnVariableValueChanged event logged for the Post Refresh variable but not the Pre Refresh variable. There are some log entries but something is missing. Then I execute the package and look at the. In my case, at the package level. I’m using the SSIS Log Provider for SQL Server in this package. It has to be included at the container level where the variables are scoped to. Next, I include the OnVariableValueChanged event in the logging configuration. It must be enabled for each variable individually. This event is disabled by default. To enable it, go to the Properties window of the variable and make the RaiseChangedEvent property to True. I’ll use the event called OnVariableValueChanged, which as the name denotes, is triggered whenever the value of the variable changes.

Each object in SSIS has its own events that can be logged. I have two integer variables named rcTableA_PreRefresh and rcTableA_PostRefresh scoped at the package level.Ī log entry is generated when an event is triggered. If you are wondering about the funny prefixes in the object names then you can read about my naming conventions mentioned in my other blog post. The simple package looks like the image below. The Execute SQL Task named ESQLT-InsertRowsInTableA inserts 502 rows in TableA. The TableA is always blank at the beginning of the package i.e. For this demo, I’ll do an INSERT operation on a table named TableA and use variables to save the before and after INSERT row count.
