question

pvsrinivasrao avatar image
pvsrinivasrao asked

How to confgiure error logging at Source level in a Data Flow Task of SSIS

How to confgiure error logging at Source level in a Data Flow Task of SSIS Sample script used in the example. create table test_data (col1 int, col2 varchar(100)) insert into test_data values (1, '00 0'); insert into test_data values (2, '02'); OLE DB Source SQL Command with following query select * from test_data where col2=0; this qyery fails Destination is a flat file. During execution following error is reported. OLE DB Source [1] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E07. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E07 Description: "Conversion failed when converting the varchar value '00 0' to data type int.". I am getting above error when I run the package.I know the query is not correct but I am not intended to change the source query, this is sample derived from my application. In order to Log this error to a LOG file by specifying a location, what I should do? I Tried using the Error Output but that handles the errors only on the data coming from Source but not with the Query.
sql-server-2008sqlssis
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

pvsrinivasrao avatar image pvsrinivasrao commented ·
Please let me know if you need the package for testing?
0 Likes 0 ·

1 Answer

·
Daniel Ross avatar image
Daniel Ross answered
You can use Event Handlers for error logging. Click on the Event Handler tab, and choose the applicable component and the OnError event, then you can do whatever you want with the error. There are also extra System variables that hold the error description, time, etc that you can access with expressions. Good luck!
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

pvsrinivasrao avatar image pvsrinivasrao commented ·
Thank you Daniel I have created a Data Flow Task in the onerror event handler, however i get the error code, but Error descritpion is not retrived. I have used @[System::ErrorCode] & @[System::ErrorDescription] varaibles in the dervied column But error description is always empty.
0 Likes 0 ·
pvsrinivasrao avatar image pvsrinivasrao commented ·
Ihave suceessfully created this!!! thank you sou munch
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.