New-AzureSqlDatabase

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

New-AzureSqlDatabase

Creates a new Windows Azure SQL Database either for the specified SQL Database Server connection context or in the specified SQL Database Server.

Syntax

Parameter Set: ByConnectionContext
New-AzureSqlDatabase [-ConnectionContext] <IServerDataServiceContext> [-DatabaseName] <String> [-Collation <String> ] [-Edition <DatabaseEdition> ] [-Force] [-MaxSizeGB <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByServerName
New-AzureSqlDatabase [-ServerName] <String> [-DatabaseName] <String> [-Collation <String> ] [-Edition <DatabaseEdition> ] [-Force] [-MaxSizeGB <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The New-AzureSqlDatabase cmdlet creates a new SQL Database either for the specified SQL Database Server connection context or in the specified SQL Database Server. You can create a SQL Database Server connection context using the New-AzureSqlDatabaseServerContext cmdlet, and then use it with this cmdlet.

When you create a new database by specifying a SQL Database Server, the New-AzureSqlDatabase cmdlet creates a temporary connection context using the specified SQL Database Server name and the current Windows Azure subscription information to perform the operation.

Parameters

-Collation<String>

Collation for the newly created SQL Database.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ConnectionContext<IServerDataServiceContext>

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

Aliases

Context

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-DatabaseName<String>

The name of the new database.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Edition<DatabaseEdition>

The edition for the SQL Database. Acceptable values are Web and Business. The default value is Web.

Aliases

none

Required?

false

Position?

named

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

-MaxSizeGB<Int32>

The maximum size for the database in gigabytes. The acceptable values differ based on edition.

Web Edition values: 1 or 5

Business Edition values: 10, 20, 30, 40, 50, 100, or 150

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ServerName<String>

The SQL Database Server name where you want to create new SQL 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 executing the command.

Required?

false

Position?

named

Default Value

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Required?

false

Position?

named

Default Value

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

Inputs

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

Outputs

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

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

Notes

  • To delete a database that was created by New-AzureSqlDatabase, use the Remove-AzureSqlDatabase cmdlet.

Examples

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

This example creates a new SQL Database with the name, "Database1", for the specified SQL Database Server connection context “$ctx”.

C:\PS>$database1 = New-AzureSqlDatabase -ConnectionContext $ctx -DatabaseName "Database1" -Edition "Business" -MaxSizeGB 50 -Collation "SQL_Latin1_General_CP1_CI_AS"

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

This example creates a new database with the name, "Database1", in the specified SQL Database Server "lpqd0zbr8y".

C:\PS>$database1 = New-AzureSqlDatabase -ServerName "lpqd0zbr8y" -DatabaseName "Database1" -Edition "Business" -MaxSizeGB 50 -Collation "SQL_Latin1_General_CP1_CI_AS"



Get-AzureSqlDatabase

Remove-AzureSqlDatabase

Set-AzureSqlDatabase

New-AzureSqlDatabaseServerContext