The AddCategory stored procedure returns the categoryID of the category but this value is ignored in the code.
However, the WriteLog stored procedure uses the integer LogID of the newly inserted record and returns that as a return value and an output parameter. The FormattedDatabaseTraceListener extracts the output parameter and converts it to an int. This
LogID int value is then used to insert an entry in the CategoryLog table.
So it looks like you cannot use the FormattedDatabaseTraceListener and still maintain the category information. You could switch the LogID column to be a UNIQUEIDENTIFIER but you would still need to set an int value because the code is expecting
it (and the AddCategory stored procedure expects an int value as Log ID).
If you wanted everything to work together 100% with GUID values then you should probably create a new Trace Listener to do exactly what you want. See Extended Properties Trace Listener with Custom Exception Handler on the
Samples page for a custom database trace listener (to modify).
If you don't care about the category you could hard code an int value in the WriteLog stored procedure and have the AddCategory stored procedure ignore the logID value
Enterprise Library support engineer