Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Set-AzureSqlDatabase

Set-AzureSqlDatabase

microsoft.windowsazure.commands.sqldatabase.dll

Synopsis

Sets properties for a specified Azure SQL Database.

Syntax

Set-AzureSqlDatabase [-ConnectionContext] [-Database] [-NewDatabaseName] [-Edition] [-MaxSizeGB] [-MaxSizeBytes] [-ServiceObjective] [-PassThru] [-Force] [-Sync] [-WhatIf] [-Confirm] [<CommonParameters>]

Set-AzureSqlDatabase [-ConnectionContext] [-DatabaseName] [-NewDatabaseName] [-Edition] [-MaxSizeGB] [-MaxSizeBytes] [-ServiceObjective] [-PassThru] [-Force] [-Sync] [-WhatIf] [-Confirm] [<CommonParameters>]

Set-AzureSqlDatabase [-ServerName] [-DatabaseName] [-NewDatabaseName] [-Edition] [-MaxSizeGB] [-MaxSizeBytes] [-ServiceObjective] [-PassThru] [-Force] [-Sync] [-WhatIf] [-Confirm] [<CommonParameters>]

Set-AzureSqlDatabase [-ServerName] [-Database] [-NewDatabaseName] [-Edition] [-MaxSizeGB] [-MaxSizeBytes] [-ServiceObjective] [-PassThru] [-Force] [-Sync] [-WhatIf] [-Confirm] [<CommonParameters>]

Detailed Description

The Set-AzureSqlDatabase cmdlet sets properties for a SQL Database in a SQL Database Server. You can specify the database by name or pass a SQL Database object through the pipeline. You can specify the SQL Database Server with a SQL Database Server connection context that you create using the New-AzureSqlDatabaseServerContext cmdlet. Or, if you specify the name of the SQL Database Server, the cmdlet uses the current Azure subscription information to authenticate the request to access the server.

Parameters

-ConnectionContext <IServerDataServiceContext>

The connection context to a SQL Database Server where you want to modify a SQL Database.

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Database <Database>

A database object representing the SQL Database to modify.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

true (ByValue)

Accept wildcard characters?

false

-NewDatabaseName <String>

If specified, the new name of the SQL Database.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Edition <DatabaseEdition>

If specified, the new edition for the SQL Database. Acceptable values are Web, Business, Basic, Standard, and Premium.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-MaxSizeGB <Int32>

If specified, the new maximum size for the database in gigabytes. You can specify either this parameter or MaxSizeBytes. The acceptable values differ based on edition. Web Edition values: 1 or 5 Business Edition values: 10, 20, 30, 40, 50, 100, or 150

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-MaxSizeBytes <Int64>

If specified, 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

-ServiceObjective <ServiceObjective>

If specified, an object representing the new service objective for this database. Note: This parameter is currently available in preview. To learn more about the preview, please see http://go.microsoft.com/fwlink/p/?LinkId=308949.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-PassThru <SwitchParameter>

Returns the updated Azure SQL Database.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Force <SwitchParameter>

Allows the action to complete without prompting you for confirmation.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Sync <SwitchParameter>

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-WhatIf <SwitchParameter>

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

-Confirm <SwitchParameter>

Prompts you for confirmation before running the cmdlet.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

-DatabaseName <String>

The name of the SQL Database to modify.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ServerName <String>

The name of the SQL Database Server where you want to modify a SQL Database.

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

Input Type

Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.Database

Return Type

Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.Database

Notes

Examples

-------------------------- EXAMPLE 1 --------------------------

This example changes the current size of the database, "Database1", to 20 GB, in the specified SQL Database Server connection context “$ctx”.

PS C:\> C:\PS>$database1 = Get-AzureSqlDatabase -ConnectionContext $ctx -DatabaseName "Database1"
C:\PS>Set-AzureSqlDatabase -ConnectionContext $ctx -Database $database1 -MaxSizeGB 20

-------------------------- EXAMPLE 2 --------------------------

This example changes the current size of the database, "Database1", to 20 GB, in the specified SQL Database Server "lpqd0zbr8y".

PS C:\> C:\PS>$database1 = Get-AzureSqlDatabase -ServerName "lpqd0zbr8y" -DatabaseName "Database1"
C:\PS>Set-AzureSqlDatabase -ServerName "lpqd0zbr8y" -Database $database1 -MaxSizeGB 20

Get-AzureSqlDatabase
New-AzureSqlDatabase
Remove-AzureSqlDatabase
New-AzureSqlDatabaseServerContext