Logging record counts in SSIS
- From: GPage <GPage@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 1 Oct 2008 16:26:02 -0700
Hello,
I have an SSIS package that loops through files in a folder using a for
each file loop control object. It then runs a data flow task for each file to
load the flat file into table. I want to get an aggregate count of how many
rows total were added to the table and put that in an audit table.
I have created a variable RowCount and put a Row Count transformation in
between the file source and database target in the data transfer task. I have
assigned the RowCount variable to the VariableName property of the Row Count
Transformation. I have also added a post execute event handler at both the
package level and the Data Transfer Task level which runs an execute sql task
that uses an expression to create the insert statement to the audit table.
The expression casts the RowCount variable as string and adds it to the
insert statement.
When I run this package it runs successfully, and several rows are added to
the audit table, I assume several rows because postexecute at the package
level runs once per task completion? The real problem though is that all the
row counts in the audit table show 0 which is what the variable is
initialized to, so it looks like the RowCount transformation is either not
working, or the variable is being re-initialized somewhere. The variable is
scoped at the package level.
I'd like some help in figuring out why the variable is not storing the
rowcounts like it should.
Thanks
.
- Follow-Ups:
- RE: Logging record counts in SSIS
- From: Todd C
- RE: Logging record counts in SSIS
- Prev by Date: DTS running way over normal time
- Next by Date: RE: DTS running way over normal time
- Previous by thread: DTS running way over normal time
- Next by thread: RE: Logging record counts in SSIS
- Index(es):
Relevant Pages
|