November 9, 2015 at 10:18 pm
I have a SQL 2012 Script Component that I use as a source. It has three outputs which I create with direct database calls inside the script.
As I process each output I record the number of records using local variables in the CreateNewOutputRows() method.
Then in the PostExecture I set the read/write variables to that count.
{
base.PostExecute();
Variables.AHasData = AHasData;
Variables.SHasData = SHasData;
Variables.DateTimeStamp = DateTimeStamp;
}
These were never set and a break point in the code show that the PostExecute method never gets called.
I created another simple package and tried to set a varialbe in the PostExecute again on a Source Script Component with the same result.
{
base.PostExecute();
Variables.value1 = "some value";
}
Am i missing something. Does the OnExecute NOT fire if there are no record or if the Script-Component is a source.
I can find no reason for this action and no description at MSDN which might account for it.
Regards
November 10, 2015 at 12:43 am
I just created a very simple script component source.
public override void PreExecute()
{
base.PreExecute();
ComponentMetaData.FireInformation(10, "Process Values", "Pre Execute", "", 0, true);
}
public override void PostExecute()
{
base.PostExecute();
ComponentMetaData.FireInformation(10, "Process Values", "Post Execute", "", 0, true);
}
public override void CreateNewOutputRows()
{
ComponentMetaData.FireInformation(10, "Process Values", "CreateNewOutputRows", "", 0, true);
Output0Buffer.AddRow();
Output0Buffer.Crap = 1;
}
And I can confirm that the output included:
Information: 0xA at Data Flow Task, Process Values: Pre Execute
Information: 0xA at Data Flow Task, Process Values: CreateNewOutputRows
Information: 0xA at Data Flow Task, Process Values: Post Execute
So the events are firing ... at least in 2014.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply