When loading data to the tables, I create an exception table with the same structure of the table to have the rows that has not been loaded successfully to the table.

I also want the exception table to capture the sql error code and messages. What option should I add when loading to have the error message and error code to be inserted into the exception table.

Thanks for the help in advance!