Edit

Share via


Remove-AzSqlInstanceDatabase

Removes an Azure SQL Managed Instance database.

Syntax

RemoveInstanceDatabaseFromInputParameters (Default)

Remove-AzSqlInstanceDatabase
    [-Name] <String>
    [-InstanceName] <String>
    [-ResourceGroupName] <String>
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RemoveInstanceDatabaseFromAzureSqlManagedDatabaseModelInstanceDefinition

Remove-AzSqlInstanceDatabase
    [-InputObject] <AzureSqlManagedDatabaseModel>
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RemoveInstanceDatabaseFromAzureResourceId

Remove-AzSqlInstanceDatabase
    [-ResourceId] <String>
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-AzSqlInstanceDatabase cmdlet removes an Azure SQL Managed Instance database.

Examples

Example 1: Remove a database from an instance

Remove-AzSqlInstanceDatabase -Name "Database01" -InstanceName "managedInstance1" -ResourceGroupName "ResourceGroup01"

This command removes the database named Database01 from instance managedInstance1.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Skip confirmation message for performing the action

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

-InputObject

The Instance Database object to remove

Parameter properties

Type:AzureSqlManagedDatabaseModel
Default value:None
Supports wildcards:False
DontShow:False
Aliases:InstanceDatabase

Parameter sets

RemoveInstanceDatabaseFromAzureSqlManagedDatabaseModelInstanceDefinition
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-InstanceName

The instance name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveInstanceDatabaseFromInputParameters
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The name of the Azure SQL Instance Database to remove.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:InstanceDatabaseName

Parameter sets

RemoveInstanceDatabaseFromInputParameters
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

The name of the resource group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveInstanceDatabaseFromInputParameters
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceId

The resource id of Instance Database object to remove

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

RemoveInstanceDatabaseFromAzureResourceId
Position:0
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:None
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.

Inputs

AzureSqlManagedDatabaseModel

String

Outputs

AzureSqlManagedDatabaseModel