| title | MOVE CONVERSATION (Transact-SQL) | |||||
|---|---|---|---|---|---|---|
| description | MOVE CONVERSATION (Transact-SQL) | |||||
| author | WilliamDAssafMSFT | |||||
| ms.author | wiassaf | |||||
| ms.date | 07/26/2017 | |||||
| ms.service | sql | |||||
| ms.subservice | t-sql | |||||
| ms.topic | reference | |||||
| f1_keywords |
|
|||||
| helpviewer_keywords |
|
|||||
| dev_langs |
|
[!INCLUDE SQL Server - ASDBMI]
Moves a conversation to a different conversation group.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
MOVE CONVERSATION conversation_handle
TO conversation_group_id
[ ; ]
conversation_handle
Is a variable or constant containing the conversation handle of the conversation to be moved. conversation_handle must be of type uniqueidentifier.
TO conversation_group_id
Is a variable or constant containing the identifier of the conversation group where the conversation is to be moved. conversation_group_id must be of type uniqueidentifier.
The MOVE CONVERSATION statement moves the conversation specified by conversation_handle to the conversation group identified by conversation_group_id. Dialogs can be only be redirected between conversation groups that are associated with the same queue.
Important
If the MOVE CONVERSATION statement is not the first statement in a batch or stored procedure, the preceding statement must be terminated with a semicolon (;), the [!INCLUDEtsql] statement terminator.
The MOVE CONVERSATION statement locks the conversation group associated with conversation_handle and the conversation group specified by conversation_group_id until the transaction containing the statement commits or rolls back.
MOVE CONVERSATION is not valid in a user-defined function.
To move a conversation, the current user must be the owner of the conversation and the conversation group, or be a member of the sysadmin fixed server role, or be a member of the db_owner fixed database role.
The following example moves a conversation to a different conversation group.
DECLARE @conversation_handle UNIQUEIDENTIFIER,
@conversation_group_id UNIQUEIDENTIFIER ;
SET @conversation_handle =
<retrieve conversation handle from database> ;
SET @conversation_group_id =
<retrieve conversation group ID from database> ;
MOVE CONVERSATION @conversation_handle TO @conversation_group_id ; BEGIN DIALOG CONVERSATION (Transact-SQL)
GET CONVERSATION GROUP (Transact-SQL)
END CONVERSATION (Transact-SQL)
sys.conversation_groups (Transact-SQL)
sys.conversation_endpoints (Transact-SQL)