"The activated proc '[dbo].[SqlQueryNotificationStoredProcedure-<A-GUID>]' running on queue '.dbo.SqlQueryNotificationService-<A-GUID>' output the following: '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.'"
What should I do?
A: Open SQL Server Studio Manager and run the following query:
ALTER AUTHORIZATION ON DATABASE:: "<the database name>" TO AlignedElement;
If you now get a new error message indicating that the SqlQueryNotificationService couldn't locate itself, run the following queries:
ALTER DATABASE "<the database name>" SET DISABLE_BROKER;
ALTER DATABASE "<the database name>" SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
and then
ALTER DATABASE "<the database name>" SET ENABLE_BROKER;