4

I am loading about 40 files to Oracle from my SSIS ETL package. At the end of each files load process, I run a SQL query to to perform a Type-2 update for old data expiration.

The SQL Query is stored in a variable called ExpireOldRecordsQuery which is built at runtime so the EvaluateAsExpression property is set to TRUE and the Expression goes something like this

"Update MyTable Set ExpiredOn = SYSDATE Where ExpiredOn IS NULL AND DownloadID <> " + @User::CurrentDownloadId

I want to log the actual query from the ExpireOldRecordsQuery variable.

How do I make SSIS log what the expression is evaluated to?

1 Answer 1

1

Any time your variable is referenced it will evaluate to the current value. This means, the value of ExpireOldRecordsQuery will always equal the string plus the current value of @User::CurrentDownLoadId.

The ExpireOldRecordsQuery variable can be used like any other variable, so you can log it's value. If you're using SSIS logging, you can use the FireInformation() function in a Script Task to send the variable information to the SSIS log.

Sign up to request clarification or add additional context in comments.

1 Comment

"you can use the FireInformation() function in a Script Task" As somebody who is new to SSIS I found this advice promising but unhelpful. Googling for SSIS+FireInformation()+logfile didn't up anything immediately useful. Do I need to write something in VB or C# to make this happen?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.