Set-AzureSqlDatabase

Set-AzureSqlDatabase

Sets properties for an Azure SQL database, or moves an existing database into an elastic pool.

Syntax

Parameter Set: Default
Set-AzureSqlDatabase [-ResourceGroupName] <System.String> [-ServerName] <System.String> [-DatabaseName] <System.String> [-Edition <Microsoft.Azure.Commands.Sql.Database.Model.DatabaseEdition> {None | Premium | Basic | Standard | DataWarehouse} ] [-ElasticPoolName <System.String> ] [-MaxSizeBytes <System.Int64> ] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [-RequestedServiceObjectiveName <System.String> ] [-Tags <System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] 

Detailed Description

The Set-AzureSqlDatabase cmdlet sets properties for an Azure SQL database. You can specify the ElasticPoolName parameter to move a database into an elastic pool. If database is already in an elastic pool, you can specify the RequestedServiceObjectiveName parameter to assign a performance level.

Parameters

-DatabaseName<System.String>

Specifies the name of the database.

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Edition<Microsoft.Azure.Commands.Sql.Database.Model.DatabaseEdition>

Specifies the edition for the database. Valid values are:
-- Default
-- None
-- Premium
-- Basic
-- Standard

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ElasticPoolName<System.String>

Specifies name of the elastic pool in which to put the database.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaxSizeBytes<System.Int64>

Specifies the new maximum size for the database in bytes. You can specify either this parameter or MaxSizeGB. See the MaxSizeGB parameter for acceptable values based on edition.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Profile<Microsoft.Azure.Common.Authentication.Models.AzureProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RequestedServiceObjectiveName<System.String>

Specifies the name of the service objective to assign to the database. For information about service objectives, see Azure SQL Database Service Tiers and Performance Levels (https://msdn.microsoft.com/en-us/library/azure/dn741336.aspx) in the Microsoft Developer Library.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ResourceGroupName<System.String>

Specifies the name of resource group of the server that contains the database.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-ServerName<System.String>

Specifies the name of the server that contains the database.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Tags<System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>

Specifies a dictionary of tags that this cmdlet associates with the new server.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.String

Outputs

The output type is the type of the objects that the cmdlet emits.

  • System.Object

Notes

  • This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters.

Examples

Example 1: Update a database to a Standard S2 database

This command updates a database named Database04 to a Standard S2 database in a server named Server01.

PS C:\> Set-AzureSqlDatabase -ResourceGroupName "ResourceGroup11" -DatabaseName "Database04" -ServerName "Server01" -Edition "Standard" -RequestedServiceObjectiveName "S2"

Example 2: Add a database to an elastic pool

The following command adds a database named Database05 to the elastic pool named ElasticPool01 in the server named Server01.

PS C:\> Set-AzureSqlDatabase -ResourceGroupName "ResourceGroup11" -DatabaseName "Database05" -ServerName "Server01" -ElasticPoolName "ElasticPool01"

Get-AzureSqlDatabase

New-AzureSqlDatabase

Remove-AzureSqlDatabase

Resume-AzureSqlDatabase

Suspend-AzureSqlDatabase

Azure SQL Database