セールス: 1-800-867-1380
EN
このコンテンツは設定された言語で表示できません。英語版のページが表示されます。

Remove-AzureSqlDatabase

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

This cmdlet deletes an Azure SQL Database by server connection context or server name. You can create a SQL Database Server connection context using the New-AzureSqlDatabaseServerContext cmdlet, and then use it with this cmdlet.

When you delete a database by specifying a SQL Database Server name, the Remove-AzureSqlDatabase cmdlet uses the name and the current Azure subscription information to perform the operation.

Parameters

-ConnectionContext<IServerDataServiceContext>

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


Aliases

Context

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Database<Database>

A database object representing the database to be removed.


Aliases

InputObject

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-DatabaseName<String>

The name of the SQL Database to be removed.


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>

The name of SQL Database Server where you want to delete 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: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

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, this cmdlet prompts the user for confirmation by default. This can be overridden by using the -Force parameter.

Examples

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

This example removes the database "Database1" from the specified SQL Database Server connection context “$ctx”.


C:\PS>Remove-AzureSqlDatabase -ConnectionContext $ctx -DatabaseName "Database1"

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

This example removes the database "Database1" from the specified SQL Database Server "lpqd0zbr8y".


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

-------------------------- EXAMPLE 3 --------------------------

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


C:\PS>$database1 | Remove-AzureSqlDatabase -ConnectionContext $ctx
C:\PS>$database1 | Remove-AzureSqlDatabase -ServerName "lpqd0zbr8y"

Related topics

この情報は役に立ちましたか。
(残り 1500 文字)
フィードバックをいただき、ありがとうございました
表示:
© 2014 Microsoft