Take a look at the TestStand help topic "Customizing Database Logging Expressions" for starters.
The key issue to understand is that the database logger treats TestStand results as a tree where the top most MainSequence step result is the a "UUT Result", then the logger processes the top most Main Sequence step result as a "Step Result", and the logger recurses into the step results from the sequence call. As it processes each step result, the logger recurses on the subproperties of the step result as a "Property Result".
As the logger operates on a UUT, step, or property result, the logger updates the subproperties under the Logging property to refer to the contents of the corresponding result.
For each result that the logger processes, the logger evaluates the statements that match the corresponding result type, evaluates the Types to Log, Precondition and Expected Properties settings to decide whether the statement must be processed, and if the statement is processed, the logger evaluates the Precondition and Expected Properties settings to decide whether the column must be processed. The logger evaluates the Value To Log setting to determine what value to assign to the column in the table.
Scott Richardson