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 Remove-AzureSqlDatabase cmdlet deletes an Azure SQL Database by server connection context or server name.
You can create an Azure SQL Database server connection context using the New-AzureSqlDatabaseServerContext cmdlet, and then use it with this cmdlet.
When you delete a database by specifying an Azure SQL Database server name, the Remove-AzureSqlDatabase cmdlet uses the name and the current Azure subscription information to perform the operation.
This example demonstrates the alternative method of passing the database object through the pipeline.
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 from which this cmdlet removes a database.
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 database that this cmdlet removes.
Parameter properties
Type:
Database
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
InputObject
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 removes.
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
-Force
Allows the action to complete without prompting the user 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
-Profile
Specifies the Azure profile from which this cmdlet reads.
If you do not specify a profile, this cmdlet reads from the local default profile.
Parameter properties
Type:
AzureSMProfile
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
-ServerName
Specifies the name of the server on which this cmdlet deletes the database.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByNameWithServerName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
Value from remaining arguments:
False
ByObjectWithServerName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
True
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.