Partager via


Update Database (classic)

 

THIS TOPIC APPLIES TO: noSQL Server yesAzure SQL DatabaseyesAzure SQL Data Warehouse noParallel Data Warehouse

Updates existing database details.

Important

The recommended REST commands to work with SQL Database are the Resource Manager based Azure SQL Database REST API. While there is no change to SQL Database, be aware that the classic deployment model command in this article is scheduled for deprecation on December 1, 2019. For a table providing links to the specific new commands you should use, see Operations for Azure SQL Databases.

Request

The Update Database request must be specified as follows:

  • Replace {subscriptionId} with your subscription ID.

  • Replace {serverName} with your server name.

  • Replace {databaseName} with your database name.

Method Request URI HTTP Version
PUT https://management.core.windows.net:8443/{subscriptionId}/services/sqlservers/servers/{serverName}/databases/{databaseName} HTTP/1.1

If an operation on databases, excluding those that cause service level objective (SLO) changes, succeeds, the operation is complete and changes are effective immediately. If an operation fails because of a user error, no changes will be applied. If there is a communication error or an internal server error, query the operation’s progress using Database Operation Status (classic) or check for the existence of the database using Get Database (classic).

For database operation with SLO changes (or those not in shared SLO), the operation will return success if initial validation succeed. The actual operation will be carried out asynchronously. You can query the operation’s progress using Database Operation Status (classic) or Get Database (classic).

To determine if the database is available for use, use Database Operation Status (classic).

This method is not re-entrant.

URI Parameters

None.

Request Headers

The following table describes the required and optional request headers:

Request Header Description
x-ms-version Required. Specifies the version of the operation to use for this request. This header should be set to 2012-03-01.
x-ms-client-request-id Optional. Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. Using this header is highly recommended for correlating client-side activities with requests received by the server. For more information, see About Storage Analytics Logging and Windows Azure Storage Logging: Using Logs to Track Storage Requests.

Request Body

The format of the request body is as follows:

<ServiceResource xmlns="https://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
  <Name>testdb2</Name>  
  <Edition>Web</Edition>  
  <MaxSizeBytes>5368709120</MaxSizeBytes>  
  <ServiceObjectiveId>910B4FCB-8A29-4C3E-958F-F7BA794388B2</ServiceObjectiveId>  
</ServiceResource>  

The following table describes the elements of the request body.

Element Name Description
Name Optional. The new name for the database.
Edition Optional. The new edition for the database. For more information, see Azure SQL Database Service Tiers (Editions)
MaxSizeBytes Optional. The new size of the database in bytes. For information on available sizes for each edition, see Azure SQL Database Service Tiers (Editions).
ServiceObjectiveID Optional. The new service level to apply to the database.

 Basic: dd6d99bb-f193-4ec1-86f2-43d3bccbc49c

 Standard (S0): f1173c43-91bd-4aaa-973c-54e79e15235b

 Standard (S1): 1b1ebd4d-d903-4baa-97f9-4ea675f5e928

 Standard (S2): 455330e1-00cd-488b-b5fa-177c226f28b7

 Standard (S3): 789681b8-ca10-4eb0-bdf2-e0b050601b40

 Premium (P1): 7203483a-c4fb-4304-9e9f-17c71c904f5d

 Premium (P2): a7d1b92d-c987-4375-b54d-2b1d0e0f5bb0

 Premium (P3): a7c4c615-cfb1-464b-b252-925be0a19446

 Web: Not recommended. See Web and Business Edition Sunset FAQ.

 Business: Not recommended. See Web and Business Edition Sunset FAQ.

*Standard (S3) is part of the Latest SQL Database Update V12 (preview). For more information, see What's New in the Azure SQL Database V12 Preview.

Response

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Header Description
x-ms-request-id A value that uniquely identifies a request made against the database management service. This request id is used for request tracking. If a failure occurs that requires the user to contact Microsoft Support, the request id should be provided to Microsoft to assist in tracking and resolving the failure for the request.

Response Body

For information about the response body, see Get Database (classic).

See Also

Common REST API Error Codes
Operations for Azure SQL Databases
Azure SQL Database
Azure SQL Database Cmdlets