PedroCGD


Following the blog of jamie, I was trying to aply it to my project... but my requirments are a little different than him...

http://blogs.conchango.com/jamiethomson/archive/2005/06/11/SSIS_3A00_-Custom-Logging-Using-Event-Handlers.aspx CommentPosted=true#commentmessage

I have inside the ControlFlow several sequence containers and inside each container I have several dataflows. I want to get the time of each dataflow execution and the rows inserted in each.

So I added a row count transform for each dataflow and added a global variable to save the rows count value. In each dataflow I need to initialize this global variable to 0. And my problem is that using event handlers in OnPostExecute it repeats several times for each dataflow... how can I save info only once for each dataflow using eventhandlers

How can make eventhandler execute only once to save the related information for each dataflow

Understood

regards

Code Snippet

"INSERT INTO SSISLog(TaskStartTime, EventType, PackageName, TaskName, PackageDuration, ContainerDuration, InsertCount, UpdateCount, DeleteCount, Host)

VALUES( '" + (DT_STR, 4, 1252) DATEPART("yyyy", @[System::EventHandlerStartTime]) + "-"

+(DT_STR, 4, 1252) DATEPART("mm", @[System::EventHandlerStartTime]) + "-"

+(DT_STR, 4, 1252) DATEPART("dd", @[System::EventHandlerStartTime]) + " "

+(DT_STR, 4, 1252) DATEPART("hh", @[System::EventHandlerStartTime]) + ":"

+(DT_STR, 4, 1252) DATEPART("mi", @[System::EventHandlerStartTime]) + ":"

+(DT_STR, 4, 1252) DATEPART("ss", @[System::EventHandlerStartTime]) +"',

'OnPostExecute',

'"+@[System::PackageName]+"',

'"+@[System::TaskName]+"',

"+ (DT_STR, 6, 1252)DATEDIFF( "ss", @[System::StartTime] , GETDATE() ) + ",

"+ (DT_STR, 6, 1252)DATEDIFF( "ss", @[System::ContainerStartTime] , GETDATE() ) + ",

" + (DT_STR, 4, 1252) @[User::SSIS_Rows] + ",

2,

3,

'"+ @[System::SourceDescription] +"')"





Re: SSIS Logs

Yitzhak Khabinsky


You can try to execute your package outside of BIDS by using dtexec.exe.

It should help you to reduce amount of logging.

Regards,

Yitzhak






Re: SSIS Logs

PedroCGD

I dont think so, but could you give me an example of what you told

Regards and thanks!







Re: SSIS Logs

Yitzhak Khabinsky

You can try something like this in the OS command prompt:

dtexec /file c:\SSIS\Test\Test\Test.dtsx

Regards,

Yitzhak





Re: SSIS Logs

PedroCGD

Dear Friend,

I dont know what are you talking about... my problem is not running a package, is saving customized logs of some dataflows... like count inserted rows, dataflow duration... etc...

So your answer didn's respond to my question, but thanks.

Regards






Re: SSIS Logs

Phil Brammer

Why don't you use an Execute SQL Task to perform your logging insert Place an Execute SQL Task between each data flow.





Re: SSIS Logs

PedroCGD

Dear Phil,

I know I can do that using SQL Task, but I want to make use of EventHandlers. If is not possible, I will obliged to use SQL task...

Regards and thanks!






Re: SSIS Logs

jwelch

Put the Insert Execute SQL Task in the PreExecute event.