The cmdlets referenced in this documentation are for managing legacy Azure resources that use
Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating
new resources since ASM is scheduled for retirement. For more information, see
Azure Service Manager retirement.
The Az PowerShell module is the recommended
PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.
The Set-AzureSqlDatabase cmdlet sets properties for an Azure SQL Database.
You can specify the database by name, or pass an Azure SQL Database object through the pipeline.
You can specify the server by name, or pass an Azure SQL Database server connection context.
Create a connection context by running the New-AzureSqlDatabaseServerContext cmdlet.
If you specify the server by name, the cmdlet uses the current Azure subscription information to authenticate the request.
Examples
Example 1: Change the size of a database by using a connection context
This example changes the size of the database named Database01 to 20 GB in the server named lpqd0zbr8y.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
cf
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ConnectionContext
Specifies the connection context of a server.
Parameter properties
Type:
IServerDataServiceContext
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
Context
Parameter sets
ByNameWithConnectionContext
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
ByObjectWithConnectionContext
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
-Database
Specifies an object that represents the Azure SQL Database that this cmdlet modifies.
Parameter properties
Type:
Database
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByObjectWithConnectionContext
Position:
Named
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
ByObjectWithServerName
Position:
Named
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DatabaseName
Specifies the name of the database that this cmdlet modifies.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByNameWithConnectionContext
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ByNameWithServerName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Edition
Specifies the new edition for the Azure SQL Database.
Valid values are:
None
Web
Business
Basic
Standard
Premium
Parameter properties
Type:
DatabaseEdition
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Force
Allows the action to complete without prompting you for confirmation.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-MaxSizeBytes
Specifies the new maximum size for the database in bytes.
You can specify either this parameter or the MaxSizeGB parameter.
See the MaxSizeGB parameter for acceptable values based on edition.
Parameter properties
Type:
Int64
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-MaxSizeGB
Specifies the new maximum size for the database in gigabytes.
You can specify either this parameter or the MaxSizeBytes parameter.
The acceptable values differ based on edition.
Basic Edition values: 1 or 2
Standard Edition values: 1, 2, 5, 10, 20, 30, 40, 50, 100, 150, 200, or 250
*Standard (S3) is part of the Latest SQL Database Update V12 (preview).
Parameter properties
Type:
ServiceObjective
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Sync
The Set-AzureSqlDatabase cmdlet sets properties for an Azure SQL Database.
You can specify the database by name, or pass an Azure SQL Database object through the pipeline.
You can specify the server by name, or pass an Azure SQL Database server connection context.
Create a connection context by running the New-AzureSqlDatabaseServerContext cmdlet.
If you specify the server by name, the cmdlet uses the current Azure subscription information to authenticate the request.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
wi
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.