SALES: 1-800-867-1380

New-AzureSqlDatabase

New-AzureSqlDatabase

Creates a new Azure SQL Database.

Syntax

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

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




Detailed Description

This cmdlet creates a new Azure SQL Database. You can specify the server with an Azure SQL Database Server connection context that you create using the New-AzureSqlDatabaseServerContext cmdlet. Or, if you specify the server name, the cmdlet uses the current Azure subscription information to authenticate the request to access the server.

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

Parameters

-Collation<String>

Collation for the new database.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ConnectionContext<IServerDataServiceContext>

The connection context to an Azure SQL Database Server where you want to create the new 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 new Azure SQL Database. Acceptable values are Web, Business, Basic, Standard, or Premium. 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

-MaxSizeBytes<Int64>

The maximum size of the database in bytes. You can specify either this parameter or MaxSizeGB. See the MaxSizeGB parameter for acceptable values based on edition.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaxSizeGB<Int32>

The maximum size of the database in gigabytes. You can specify either this parameter or MaxSizeBytes. The acceptable values differ based on edition:

Basic Edition values: 1 or 2

Standard Edition values: 1, 2, 5, 10, 20, 30, 40, 50, 100, 150, 200, or 250

Premium Edition values: 1, 2, 5, 10, 20, 30, 40, 50, 100, 150, 200, 250, 300, 400, or 500

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 name of the Azure SQL Database Server to contain the new database.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ServiceObjective<ServiceObjective>

If specified, an object representing the new service objective (performance level) for this database. This value represents the level of resources assigned to this database. Acceptable values are:

Basic: dd6d99bb-f193-4ec1-86f2-43d3bccbc49c

Standard (S0): f1173c43-91bd-4aaa-973c-54e79e15235b

Standard (S1): 1b1ebd4d-d903-4baa-97f9-4ea675f5e928

Standard (S2): 455330e1-00cd-488b-b5fa-177c226f28b7

*Standard (S3): 789681b8-ca10-4eb0-bdf2-e0b050601b40

Premium (P1): 7203483a-c4fb-4304-9e9f-17c71c904f5d

Premium (P2): a7d1b92d-c987-4375-b54d-2b1d0e0f5bb0

Premium (P3): a7c4c615-cfb1-464b-b252-925be0a19446

*Standard (S3) is part of the Latest SQL Database Update V12 (preview). For more information, see What's New in the Azure SQL Database V12 Preview.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

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.

Outputs

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

  • Microsoft.WindowsAzure.Commands.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 Azure SQL Database with the name, "Database1", for the specified Azure 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 Azure SQL Database Server "lpqd0zbr8y". The cmdlet uses the current Azure subscription information to authenticate the request to access the server.


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

Related topics

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft