In Control Compliance Suite (CCS) you are seeing the following
Error 'Cannot execute as the database principal because the principal "guest" does not exist, this type of principal cannot be impersonated, or you do not have permission' when importing Agent-based SQL Server assets.
When trying to import SQL Server assets from a CCS 12.6.x agent that has the SQL Snap-in installed, it returns the following error:
EXAMPLE.COM\EXAMPLE: Source [Microsoft SQL-DMO (ODBC SQLState: 42000)]; Description [[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot execute as the database principal because the principal "guest" does not exist, this type of principal cannot be impersonated, or you do not have permission.]
Check the following to resolve the error:
If “NT Authority\System” or whatever account the SQL Server service is running under DOES NOT have “db_datareader” role, then Asset Import job will return the following error:
EXAMPLE.COM\EXAMPLE: Source [Microsoft SQL-DMO (ODBC SQLState: 42000)]; Description [[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot execute as the database principal because the principal "guest" does not exist, this type of principal cannot be impersonated, or you do not have permission.]