All messages are part of a conversation. Therefore, an initiating service must begin a conversation with the target service before sending a message to the target service. The information specified in the BEGIN DIALOG CONVERSATION statement is similar to the address on a letter; Service Broker uses the information to deliver messages to the correct service. The service specified in the TO SERVICE clause is the address that messages are sent to. The service specified in the FROM SERVICE clause is the return address used for reply messages.
The target of a conversation does not need to call BEGIN DIALOG CONVERSATION. Service Broker creates a conversation in the target database when the first message in the conversation arrives from the initiator.
Beginning a dialog creates a conversation endpoint in the database for the initiating service, but does not create a network connection to the instance that hosts the target service. Service Broker does not establish communication with the target of the dialog until the first message is sent.
When the BEGIN DIALOG CONVERSATION statement does not specify a related conversation or a related conversation group, Service Broker creates a new conversation group for the new conversation.
Service Broker does not allow arbitrary groupings of conversations. All conversations in a conversation group must have the service specified in the FROM clause as either the initiator or the target of the conversation.
The BEGIN DIALOG CONVERSATION command locks the conversation group that contains the dialog_handle returned. When the command includes a RELATED_CONVERSATION_GROUP clause, the conversation group for dialog_handle is the conversation group specified in the related_conversation_group_id parameter. When the command includes a RELATED_CONVERSATION clause, the conversation group for dialog_handle is the conversation group associated with the related_conversation_handle specified.
BEGIN DIALOG CONVERSATION is not valid in a user-defined function.