Get-AzureRmSqlDatabase
Syntax
Get-AzureRmSqlDatabase
[-ResourceGroupName] <String>
[-ServerName] <String>
[[-DatabaseName] <String>]
[-Confirm]
[-WhatIf]
[<CommonParameters>]
Description
The Get-AzureRmSqlDatabase cmdlet gets one or more Azure SQL databases from an Azure SQL Database Server.
This cmdlet is also supported by the SQL Server Stretch Database service on Azure.
Examples
Example 1: Get all databases on a server
PS C:\>Get-AzureRmSqlDatabase -ResourceGroupName "resourcegroup01" -ServerName "server01"
ResourceGroupName : resourcegroup01
ServerName : server01
DatabaseName : master
Location : Central US
DatabaseId : a2a7f2db-7526-4d86-a7b2-36276ee10dc6
Edition : None
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 5368709120
Status : Online
CreationDate : 7/3/2015 7:32:44 AM
CurrentServiceObjectiveId : c99ac918-dbea-463f-a475-16ec020fdc12
CurrentServiceObjectiveName : System1
RequestedServiceObjectiveId : c99ac918-dbea-463f-a475-16ec020fdc12
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
Tags :
ResourceGroupName : resourcegroup01
ServerName : server01
DatabaseName : database01
Location : Central US
DatabaseId : a1e6bd1a-735a-4d48-8b98-afead5ef1218
Edition : Standard
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 268435456000
Status : Online
CreationDate : 7/3/2015 7:33:37 AM
CurrentServiceObjectiveId : f1173c43-91bd-4aaa-973c-54e79e15235b
CurrentServiceObjectiveName : S0
RequestedServiceObjectiveId : f1173c43-91bd-4aaa-973c-54e79e15235b
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
Tags :
This command gets all databases on the server named server01.
Example 2: Get a database by name on a server
PS C:\>Get-AzureRmSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database02"
ResourceGroupName : resourcegroup01
ServerName : server01
DatabaseName : database01
Location : Central US
DatabaseId : a1e6bd1a-735a-4d48-8b98-afead5ef1218
Edition : Standard
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 268435456000
Status : Online
CreationDate : 7/3/2015 7:33:37 AM
CurrentServiceObjectiveId : f1173c43-91bd-4aaa-973c-54e79e15235b
CurrentServiceObjectiveName : S0
RequestedServiceObjectiveId : f1173c43-91bd-4aaa-973c-54e79e15235b
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
Tags :
This command gets a database named Database02 from a server named Server01.
Required Parameters
Specifies the name of the resource group to which the database server is assigned.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
Specifies the name of the server to which the database is assigned.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
Optional Parameters
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the database to retrieve.
| Type: | String |
| Aliases: | Name |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Outputs
Microsoft.Azure.Commands.Sql.Database.Model.AzureSqlDatabaseModel