| title | The Azure CLI: Move a database between elastic pools |
|---|---|
| description | Use an Azure CLI example script to create two elastic pools and move a database in SQL Database from one elastic pool to another. |
| services | sql-database |
| ms.service | sql-database |
| ms.subservice | elastic-pools |
| ms.custom | sqldbrb=1 |
| ms.devlang | azurecli |
| ms.topic | sample |
| author | stevestein |
| ms.author | sstein |
| ms.reviewer | |
| ms.date | 06/25/2019 |
This Azure CLI script example creates two elastic pools, moves a pooled database in SQL Database from one SQL elastic pool into another SQL elastic pool, and then moves the pooled database out of the SQL elastic pool to be a single database in SQL Database.
If you choose to install and use the CLI locally, this topic requires that you are running the Azure CLI version 2.0 or later. Run az --version to find the version. If you need to install or upgrade, see Install the Azure CLI.
[!INCLUDE quickstarts-free-trial-note]
[!code-azurecli-interactivemain]
Use the following command to remove the resource group and all resources associated with it.
az group delete --name $resource
This script uses the following commands. Each command in the table links to command-specific documentation.
| Command | Description |
|---|---|
| az sql server | Server commands. |
| az sql elastic-pools | Elastic pool commands. |
| az sql db | Database commands. |
For more information on the Azure CLI, see Azure CLI documentation.
Additional SQL Database CLI script samples can be found in the Azure SQL Database documentation.