| title | ALTER DATABASE (Azure SQL Data Warehouse) | Microsoft Docs | ||
|---|---|---|---|
| ms.custom |
|
||
| ms.date | 03/03/2017 | ||
| ms.prod | |||
| ms.reviewer | |||
| ms.service | sql-warehouse | ||
| ms.suite | |||
| ms.technology |
|
||
| ms.tgt_pltfrm | |||
| ms.topic | language-reference | ||
| dev_langs |
|
||
| ms.assetid | da712a46-5f8a-4888-9d33-773e828ba845 | ||
| caps.latest.revision | 20 | ||
| author | barbkess | ||
| ms.author | barbkess | ||
| manager | jhubbard |
[!INCLUDEtsql-appliesto-xxxxxx-xxxx-asdw-xxx_md]
Modifies the name, maximum size, or service objective for a database.
Transact-SQL Syntax Conventions
-- Syntax for Azure SQL Data Warehouse
ALTER DATABASE database_name
MODIFY NAME = new_database_name
| MODIFY ( <edition_option> [, ... n] )
<edition_option> ::=
MAXSIZE = { 250 | 500 | 750 | 1024 | 5120 | 10240 | 20480 | 30720 | 40960 | 51200 | 61440 | 71680 | 81920 | 92160 | 102400 | 153600 | 204800 | 245760 } GB
| SERVICE_OBJECTIVE = { 'DW100' | 'DW200' | 'DW300' | 'DW400' | 'DW500' | 'DW600' | 'DW1000' | 'DW1200' | 'DW1500' | 'DW2000' | 'DW3000' | 'DW6000'}
database_name
Specifies the name of the database to be modified.
MODIFY NAME = new_database_name
Renames the database with the name specified as new_database_name.
MAXSIZE
The maximum size the database may grow to. Setting this value prevents the growth of the database size beyond the size set. The default MAXSIZE when not specified is 10240 GB (10 TB). Other possible values range from 250 GB up to 240 TB.
SERVICE_OBJECTIVE
Specifies the performance level. For more information about service objectives for [!INCLUDEssSDW_md], see Scale Performance on SQL Data Warehouse.
Requires these permissions:
-
Server-level principal login (the one created by the provisioning process), or
-
Member of the
dbmanagerdatabase role.
The owner of the database cannot alter the database unless the owner is a member of the dbmanager role.
The current database must be a different database than the one you are altering, therefore ALTER must be run while connected to the master database.
SQL Data Warehouse is set to COMPATIBILITY_LEVEL 130 and cannot be changed. For more details, see Improved Query Performance with Compatibility Level 130 in Azure SQL Database.
To decrease the size of a database, use DBCC SHRINKDATABASE.
To run ALTER DATABASE, the database must be online and cannot be in a paused state.
The ALTER DATABASE statement must run in autocommit mode, which is the default transaction management mode. This is set in the connection settings.
The ALTER DATABASE statement cannot be part of a user-defined transaction.
You cannot change the database collation.
Before you run these examples, make sure the database you are altering is not the current database. The current database must be a different database than the one you are altering, therefore ALTER must be run while connected to the master database.
ALTER DATABASE AdventureWorks2012
MODIFY NAME = Northwind;
ALTER DATABASE dw1 MODIFY ( MAXSIZE=10240 GB );
ALTER DATABASE dw1 MODIFY ( SERVICE_OBJECTIVE= 'DW1200' );
ALTER DATABASE dw1 MODIFY ( MAXSIZE=10240 GB, SERVICE_OBJECTIVE= 'DW1200' );
CREATE DATABASE (Azure SQL Data Warehouse) SQL Data Warehouse list of reference topics