I have create a SSIS package, for data export import process, but if my task get failed then i have to send a mail with proper error description as the SSIS generate in output window.
Can any one sugget me to, how can i store that error desciption in my variable.?
Thanks in advance.
You can create a table with the following fields packageid,packagename,taskname,errormessage.
And later write a stored procedure which will insert the data into this table from the package variables. On event handler tab call this stored procedure and pass the system variables "system::executioninstanceguid","system::packagename","system::sourcename","system::errordescription".
Once this is done you can read values from this particular table and assign it to a variable and later on call it in the send mail task.Hope this will help you.
|||Use OnError Event in Event Handler and system variables such as [System::ErrorCode] and [System::ErrorDescription]
http://msdn2.microsoft.com/en-us/library/ms139744.aspx
|||
As you define above i'm doing such a way
dts.variable("User::vName").value = dts.variable("System::ErrorDescription")
but it is going me error in my script task.
:-(
please provide more specific detail or information.
|||
Hi..
1. In OnError Event Handler, Add a Script Task..
2. Define ReadWriteVariables value in ScriptTask Properties like this
ReadWriteVariables | User::vName,System::ErrorDescription
3. In VSA, edit your script like this..
Dts.Variables("vName").Value = Dts.Variables("ErrorDescription").Value.ToString
HTH
ADConsulting / SQLLeader.com / Daeseong Han
|||Thanks for you needful help.
:-)
No comments:
Post a Comment