SQL Server 2005 Service Broker Error 15517

less than 1 minute read

Sometimes I’ve run into the following error in the event log when using the service broker to do SQL command notifications with SQL 2005:

An exception occurred while enqueueing a message in the target queue. Error: 15517, State: 1. 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.

It tends to fill up the event log pretty badly when you see it. I’ve especially seen it when I move the database from one server to another. To fix it, use this command:

ALTER AUTHORIZATION ON DATABASE::[dbname] TO [SA]

This should fix it for you.

Comments