The DBoutputTable is autopropagating the metadata that is on input port to the error output port. There is no need to explicitly setting the error output metadata. So to answer your questions.
1. The ErrCode and ErrText fields are automatically added to the metadata coming through the input port.
2. If the input metadata contain some sort of ID you can see it on the output as well (due to autopropagation).
For more information please see the attached graph.
Hope this helps.