In message <3D7C9B1A-B1EA-40FD-B1CD-6F105AF5C089 (AT) microsoft (DOT) com>, whornak
<whornak (AT) discussions (DOT) microsoft.com> writes
Quote:
I did figure out that when running the tasks manually the progress
window that stays open when done does contain the messages associated
with the tasks. Is there a way to access that object?
"whornak" wrote:
I want to build error capturing and reporting into the DTS packages.
I am currently using 'Execute SQL Task' and sending emails when the
SQL Statement fails. What I want to do is provide the recipient with
as much detail as possible about the error.
How would I capture the actual error messages when a statement fails? |
Four ways to get error details -
Use GetExecutionErrorInfo method for the step, but this is only an
option in strong typed code, such as VB, not VBScript.
Execute package WithEvents and capture the OnError events.
Log errors to a file, package level option. Note error file is not
available during the current package execution.
Log errors to SQL Server, package level option. You can access the
current execution by using the lineage Id global variables, see package
level option. Still probably done easier post execution or in a parent
package.
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org