SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Exporting SSIS variables at time of error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tcarnahan
Starting Member

USA
23 Posts

Posted - 12/08/2013 :  17:41:02  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 12/09/2013 :  01:34:47  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000