I wrote a server trigger that tracks DML changes to a database and sends me an email of the changes made. The problem is the when we do CDC related tasks, it blows up and returns an error saying I don't have permissions to execute the sp_send_dbmail.
I execute the proc without any problem. I am using the fully qualified 3 partname and have
sysadmin permissions on the instance. I've even tried executing as the
sa account and it came back saying the sa account didn't have permissions to execute the procedure. Here are the errors I get:
Could not update the metadata that indicates table [SchemaName].[TableName] is enabled for Change Data Capture. The failure occurred when executing the command 'sp_cdc_create_change_table'. The error returned was 15517: 'Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.'. Use the action
View Complete Post