Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Exporting SSIS variables at time of error

Author  Topic 

tcarnahan
Starting Member

23 Posts

Posted - 2013-12-08 : 17:41:02
I am working on a project for work using SSIS 2008. The package has a number of variables, some of which are passed in by reading from the SSIS config table, others are generated internally by my execution path. I am having problems troubleshooting this package and symptoms suggest that it is because of the variables that are either being passed to the package or be manipulated by the package.

I have an on error handler that sends an error email. Right now, it is fairly "dumb" ... just tells us there was an error and dumps what SSIS said it objected to. I need more information in that email.

Question: is there a way that I can loop through all user variables and capture the names and values at the time of the error to put in my email?

Many thanks for any help you can provide!

Tom

PS. I looked through this forum and did not see anything suggesting a way to do this. I did see in another forum mention that one could not get variables out at runtime. I find this hard to believe and thought I would ask in a different forum. Those variables are in memory during execution. Why would you not be able to access them?


edit: moved to proper forum

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-09 : 01:34:47
You can. Add a variable to hold the subject of the email and make it dynamic based on expression (ie set EvaluateAsExpression true). Then in the expression part append each variables value as its contents something like

"Variable1: " + (DT_WSTR,30)@[user::variable1] + ....
Then in the sent mail task choose MessageSourceType as variable and then map this variable to message.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -