-1

I have a SSIS package that has three DataFlowTasks.

1st dataflow load data to destination table1
2nd dataflow load data to destination table2
3rd dataflow load data to destination table3

I configured logging by default to SQL Server table (ssiserrorlog) on error. but this only has startdate and enddate details but I want to log the details to SQL Server custom error log table like the below.

enter image description here

How to do this process I am new to SSIS.

StackUser
  • 5,370
  • 2
  • 24
  • 44

4 Answers4

1

You can use the Row Count component in each data flow to get the number of rows loaded.

"Duration" is just the DateDiff between Start and End Date. You could even make it a computed column in your log table, if you're not content to just calculate it at query time.

Tab Alleman
  • 31,483
  • 7
  • 36
  • 52
1

Use RowCount Transformation in each of the dataflow task before loading into the Destination. And then use this value in the SSISLogging Table

As for as duration, since you know the starttime and endtime, use the DateDiff function.

Unna
  • 42
  • 2
1

In SSIS, you will have system variables - start and endtime. Use the System Variables to capture Start and End Time

Unna
  • 42
  • 2
0

A correct solution for the RowCount and Duration has been suggested, however, there are noted datatype issues between using the system::starttime variable to transfer Package or Event starttime custom logs from SSIS to SQL.

The user will have to create a user variable (ie. user::StartTime) and likely create an expression (depending on what is being used for EndTime) in order to solve this aspect of the problem.

https://sqljunkieshare.com/2011/12/09/ssis-package-logging-custom-logging-2008-r2-and-2012/