Quantcast
Channel: SQL Service Broker forum
Viewing all articles
Browse latest Browse all 461

Stored Procedure behaves differently when activation is on?!

$
0
0

Hi,

I have got a simple stored procedure for testing purposes. When Activation is off and I run this sp myself it works correct, but when I set activation to on and send a message, the message is being pulled from the queue and I think this can only be done by the activated sp but the insert into (see sp) is not done.

here is stored procedure:

as

declare

@message_bodyasxml;


declare

@message_typeassysname;


declare

@dialogasuniqueidentifier;


 


while

(1=1)


begin


waitfor(


receivetop(1)


@message_type=message_type_name,


@message_body=cast(message_bodyasxml),


@dialog=conversation_handle


fromdbo.MADClaimCallHistoryQueue


),timeout2000;


 

if(@@ROWCOUNT=0)


begin


print'rowcount = 0'


break;


end


if(@message_type='http://schemas.microsoft.com/SQL/ServiceBroker/EndDialog')


endconversation@dialog;


elseif(@message_type='http://schemas.microsoft.com/SQL/ServiceBroker/Error')


begin

print'Dialog Error dialog #'+cast(@dialogasnvarchar(50));


endconversation@dialog;


end


elseif(@message_type='InsertMessage')


begin


print'insert';


insertintoMADLog.dbo.SBTest(xmlvar)


select@message_body


endconversation@dialog;


end

end


Viewing all articles
Browse latest Browse all 461

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>