I'm dealing with a situation where LOAD DATA operations — especially large batches with data inconsistencies — are consuming a lot of disk space. I've noticed that the same error messages are being repeatedly logged in the %SQL_Diag.Result and %SQL_Diag.Message tables, which is significantly increasing the size of the database.
One idea was to move these diagnostic tables to a separate database with a configured size limit, but before going down that path, I'd like to ask:
Is there a simpler or more efficient way to handle this? For example:
Can we limit the number of repeated logs?
Is there a way to disable or filter out redundant error messages?
Are there built-in retention or cleanup mechanisms for these tables?
Any suggestions or best practices would be greatly appreciated!