-- Tested with SQL Server 2005 9.00.852 -- Creates two dialog conversations with one -- message each and adds the second message -- to the same conversation group as that of -- the first message. USE DotNetFun; DECLARE @DialogHandle1 uniqueidentifier, @DialogHandle2 uniqueidentifier, @BrokerGUID uniqueidentifier; -- The Target service on another database: SELECT @BrokerGUID = service_broker_guid FROM sys.databases WHERE database_id = DB_ID('DotNetFun2'); -- First dialog conversation: BEGIN DIALOG CONVERSATION @DialogHandle1 FROM SERVICE DotNetFunService TO SERVICE 'DotNetFun2Service', @BrokerGUID ON CONTRACT DotNetFunContractSentByAny; SEND ON CONVERSATION @DialogHandle1 MESSAGE TYPE DotNetFunMessageTypeValidateNone ('HELLO!'); -- Second dialog conversation: BEGIN DIALOG CONVERSATION @DialogHandle2 FROM SERVICE DotNetFunService TO SERVICE 'DotNetFun2Service', @BrokerGUID ON CONTRACT DotNetFunContractSentByAny WITH RELATED_CONVERSATION = @DialogHandle1; --> ADD TO SAME GROUP SEND ON CONVERSATION @DialogHandle2 MESSAGE TYPE DotNetFunMessageTypeValidateNone ('HELLO!'); -- End both dialogs: END CONVERSATION @DialogHandle2; END CONVERSATION @DialogHandle1; /* Unfortunately, the conversation group created here will not persist past this endpoint (the Initiator side of the conversation). Microsoft has made it so that each endpoint (the Initiator and Target) have two different set of dialog and conversation group handles (via unique identifier IDs). So, don't expect to be able to receive both messages all at once - they will be received one at a time because each message will be assigned to two different conversation groups. I really don't see what the point is, therefore, for creating conversation groups other than to provide locking for all dialog conversations added to them. */