New-AzureSqlDatabase

New-AzureSqlDatabase

Creates an Azure SQL database or an elastic database.

Syntax

Parameter Set: Default
New-AzureSqlDatabase [-ResourceGroupName] <System.String> [-ServerName] <System.String> -DatabaseName <System.String> [-CatalogCollation <System.String> ] [-CollationName <System.String> ] [-Edition <Microsoft.Azure.Commands.Sql.Database.Model.DatabaseEdition> {None | Premium | Basic | Standard | DataWarehouse} ] [-ElasticPoolName <System.String> ] [-MaxSizeBytes <System.Int64> ] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [-RequestedServiceObjectiveName <System.String> ] [-Tags <System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]> ] 

Detailed Description

The New-AzureSqlDatabase cmdlet creates a new Azure SQL database.
You can also create an elastic database by setting the ElasticPoolName parameter to an existing elastic pool.

Parameters

-CatalogCollation<System.String>

Specifies the name of the Azure SQL database catalog collation.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CollationName<System.String>

Specifies the name of the Azure SQL database collation.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DatabaseName<System.String>

Specifies the name of the database.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Edition<Microsoft.Azure.Commands.Sql.Database.Model.DatabaseEdition>

Specifies the edition to assign to the database. Valid values are:
-- Default
-- None
-- Premium
-- Basis
-- Standard

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ElasticPoolName<System.String>

Specifies the name of the elastic pool in which to put the database.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MaxSizeBytes<System.Int64>

Specifies the maximum size of the database in bytes.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Profile<Microsoft.Azure.Common.Authentication.Models.AzureProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RequestedServiceObjectiveName<System.String>

Specifies the name of the service objective to assign to the database.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ResourceGroupName<System.String>

Specifies the name of the resource group that the server is in.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-ServerName<System.String>

Specifies the name of the server to create the database.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Tags<System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]>

Specifies a dictionary of tags that this cmdlet associates with the new server.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

Inputs

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

  • System.String

Outputs

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

  • System.Object

Notes

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

Examples

Example 1: Create an database in a specified server

This command creates a database named Database01 in server Server01.

PS C:\> New-AzureSqlDatabase -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database01"

Example 2: Create an elastic database in a specified server

This command creates a database named Database01 in the elastic pool named ElasticPool22 in server Server02.

PS C:\> New-AzureSqlDatabase -ResourceGroupName "ResourceGroup11" -ServerName "Server02" -DatabaseName "Database01" -ElasticPoolName "ElasticPool22"

Get-AzureSqlDatabase

Remove-AzureSqlDatabase

Resume-AzureSqlDatabase

Set-AzureSqlDatabase

Suspend-AzureSqlDatabase

Azure SQL Database

New-AzureSqlServer

New-AzureSqlElasticPool