VENTES: 1-800-867-1389
EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

Remove-AzureSqlDatabase

Updated: August 13, 2015

Remove-AzureSqlDatabase

Deletes an Azure SQL Database.

Syntax

Parameter Set: ByNameWithConnectionContext
Remove-AzureSqlDatabase [-ConnectionContext] <IServerDataServiceContext> [-DatabaseName] <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByNameWithServerName
Remove-AzureSqlDatabase [-ServerName] <String> [-DatabaseName] <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByObjectWithConnectionContext
Remove-AzureSqlDatabase [-ConnectionContext] <IServerDataServiceContext> [-Database] <Database> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByObjectWithServerName
Remove-AzureSqlDatabase [-ServerName] <String> [-Database] <Database> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

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.

Parameters

-ConnectionContext<IServerDataServiceContext>

Specifies the connection context of a server from which this cmdlet removes a database.


Aliases

Context

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Database<Database>

Specifies an object that represents the database that this cmdlet removes.


Aliases

InputObject

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-DatabaseName<String>

Specifies the name of the database that this cmdlet removes.


Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Force

Allows the action to complete without prompting the user for confirmation.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ServerName<String>

Specifies the name of the server on which this cmdlet deletes the database.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

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

Inputs

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

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

Outputs

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

Notes

  • Because of the severity of the operation, by default, this cmdlet prompts you for confirmation. To skip confirmation, specify the Force parameter.

Examples

Example 1: Remove a database

This command removes the database named Database01 from the Azure SQL Database server connection context $Context.


PS C:\> Remove-AzureSqlDatabase -ConnectionContext $Context -DatabaseName "Database01"

Example 2: Remove a database by using a server name

This command removes the database named Database01 from the Azure SQL Database server namedlpqd0zbr8y.


PS C:\> Remove-AzureSqlDatabase -ServerName "lpqd0zbr8y" -DatabaseName "Database01"

Example 3: Remove a database by using the pipeline

This example demonstrates the alternative method of passing the database object through the pipeline.


PS C:\> $Database01 | Remove-AzureSqlDatabase -ConnectionContext $Context
PS C:\> $Database01 | Remove-AzureSqlDatabase -ServerName "lpqd0zbr8y"

Related topics

Cela vous a-t-il été utile ?
(1500 caractères restants)
Merci pour vos suggestions.
Afficher:
© 2015 Microsoft