Service Broker 无法工作的问题修复

时间:2022-04-23
本文章向大家介绍Service Broker 无法工作的问题修复,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

数据库的Service Broker在通过备份/还原方式恢复数据库后,通过SELECT * FROM sys.transmission_queue 查到的错误信息:

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.

解决办法:

ALTER AUTHORIZATION ON DATABASE::[yourdatabase] TO [sa];