Thursday 20 October 2016

Retrieve Error Message in SSIS

Is there any way to get a string variable of error message shown in Execution result tab of a package.
Assume you encountered an error in your SSIS package, now all we need to log that error into your own table (other than SSIS catalog DB's), you can create a Execute SQL task with the INSERT script parameterized. Paramerter you need to use in Parameter Mapping tab isSystem::ErrorDescription.
INSERT INTO LOG_TABLE(ID,ERROR,ERROR_TIMESTAMP) VALUES(1,?,GETDATE());
Note: You can utilize other System Variables like PackageName,MachineName etc to log into the table.
Please refer screenshot below:

No comments:

Post a Comment