标签:
1 Use HelloWorldDB 2 go 3 4 SET NOCOUNT ON 5 DECLARE @conversationHandle uniqueidentifier 6 7 Begin Transaction 8 -- 开始 Hello World 服务的对话 9 10 BEGIN DIALOG @conversationHandle 11 FROM SERVICE [HelloWorldResponseService] 12 TO SERVICE ‘HelloWorldRequestService‘ 13 ON CONTRACT [HelloWorldContract] 14 WITH ENCRYPTION = OFF, LIFETIME = 600; 15 16 -- 发送消息 17 SEND ON CONVERSATION @conversationHandle 18 MESSAGE TYPE [HelloWorldRequest] (N‘Hello World‘) 19 20 commit
执行上面的发送消息代码,出现如下错误
select cast(message_body as nvarchar(MAX)) from [HelloWorldInitiatorQueue];
<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8489</Code><Description>The dialog has exceeded the specified LIFETIME.</Description></Error>
是因为权限不够导致的!
解决方法很简单:
将SQL Server实例服务器登陆身份改为local system登陆,然后重启实例服务即可;
引用自下面博客:
http://www.cnblogs.com/kerrycode/archive/2013/09/25/3339558.html
标签:
原文地址:http://www.cnblogs.com/consuvi/p/4885747.html