SALES: 1-800-867-1380
Expand Minimize

sys.databases (Azure SQL Database)

Updated: April 24, 2014

This topic is OBSOLETE. You can find the most current version in the SQL 14 Transact-SQL Reference.

ImportantImportant
This topic is not maintained. For the current version, see sys.databases (Transact-SQL).

Contains one row per database in a Azure SQL Database server. Returns information about the database states that a database goes through when it is being copied.

The database states related to copying are described in the following table:

 

Column name Data type Description

name

sysname

Name of database, unique within a Azure SQL Database server.

database_id

int

ID of the database, unique within a Azure SQL Database server.

source_database_id

int

Non-NULL = ID of the source database of this database snapshot.

NULL = Not a database snapshot.

owner_sid

varbinary(85)

SID (Security-Identifier) of the external owner of the database, as registered to the server.

create_date

datetime

Date the database was created or renamed.

compatibility_level

tinyint

Integer corresponding to the version of SQL Server for which behavior is compatible:

100

NULL = Database is not online.

collation_name

sysname

Collation for the database. Acts as the default collation in the database.

NULL = Database is not online.

user_access

tinyint

User-access setting:

0 = MULTI_USER specified

1 = SINGLE_USER specified

2 = RESTRICTED_USER specified

user_access_desc

nvarchar(60)

Description of user-access setting:

MULTI_USER

SINGLE_USER

RESTRICTED_USER

is_read_only

bit

1 = Database is READ_ONLY

0 = Database is READ_WRITE

is_auto_close_on

bit

1 = AUTO_CLOSE is ON

0 = AUTO_CLOSE is OFF

is_auto_shrink_on

bit

1 = AUTO_SHRINK is ON

0 = AUTO_SHRINK is OFF

state

tinyint

Database state:

0 = Online

1 = Restoring

4 = Suspect

7 = Copying

state_desc

nvarchar(120)

Description of the database state, one of:

 

Value Description

ONLINE

Copy has completed successfully and the new database is online.

SUSPECT

Copy has failed.

COPYING

Copy is in progress.

is_in_standby

bit

Database is read-only for restore log.

is_cleanly_shutdown

bit

1 = Database shut down cleanly; no recovery required on startup

0 = Database did not shut down cleanly; recovery is required on startup

is_supplemental_logging_enabled

bit

1 = SUPPLEMENTAL_LOGGING is ON

0 = SUPPLEMENTAL_LOGGING is OFF

snapshot_isolation_state

tinyint

1 = Snapshot isolation state ON. Snapshot isolation is allowed.

snapshot_isolation_state_desc

nvarchar(60)

Description of state of snapshot-isolation transactions being allowed, as set by the ALLOW_SNAPSHOT_ISOLATION option: ON

is_read_committed_snapshot_on

bit

1 = READ_COMMITTED_SNAPSHOT option is ON.

0 = READ_COMMITTED_SNAPSHOT option is OFF.

recovery_model

tinyint

Recovery model selected:

1 = FULL

2 = BULK_LOGGED

3 = SIMPLE

recovery_model_desc

nvarchar(60)

Description of recovery model selected:

  • FULL

  • BULK_LOGGED

  • SIMPLE

page_verify_option

tinyint

Setting of PAGE_VERIFY option:

0 = NONE

1 = TORN_PAGE_DETECTION

2 = CHECKSUM

page_verify_option_desc

nvarchar(60)

Description of PAGE_VERIFY option setting:

NONE.TORN_PAGE_DETECTION

CHECKSUM

is_auto_create_stats_on

bit

1 = AUTO_CREATE_STATISTICS is ON

0 = AUTO_CREATE_STATISTICS is OFF

is_auto_update_stats_on

bit

1 = AUTO_UPDATE_STATISTICS is ON

0 = AUTO_UPDATE_STATISTICS is OFF

is_auto_update_stats_async_on

bit

1 = AUTO_UPDATE_STATISTICS_ASYNC is ON

0 = AUTO_UPDATE_STATISTICS_ASYNC is OFF

is_ansi_null_default_on

bit

1 = ANSI_NULL_DEFAULT is ON

0 = ANSI_NULL_DEFAULT is OFF

is_ansi_nulls_on

bit

1 = ANSI_NULLS is ON

0 = ANSI_NULLS is OFF

is_ansi_padding_on

bit

1 = ANSI_PADDING is ON

0 = ANSI_PADDING is OFF

is_ansi_warnings_on

bit

1 = ANSI_WARNINGS is ON

0 = ANSI_WARNINGS is OFF

is_arithabort_on

bit

1 = ARITHABORT is ON

0 = ARITHABORT is OFF

is_concat_null_yields_null_on

bit

1 = CONCAT_NULL_YIELDS_NULL is ON

0 = CONCAT_NULL_YIELDS_NULL is OFF

is_numeric_roundabort_on

bit

1 = NUMERIC_ROUNDABORT is ON

0 = NUMERIC_ROUNDABORT is OFF

is_quoted_identifier_on

bit

1 = QUOTED_IDENTIFIER is ON

0 = QUOTED_IDENTIFIER is OFF

is_recursive_triggers_on

bit

1 = RECURSIVE_TRIGGERS is ON

0 = RECURSIVE_TRIGGERS is OFF

is_cursor_close_on_commit_on

bit

1 = CURSOR_CLOSE_ON_COMMIT is ON

0 = CURSOR_CLOSE_ON_COMMIT is OFF

is_local_cursor_default

bit

1 = CURSOR_DEFAULT is local

0 = CURSOR_DEFAULT is global

is_fulltext_enabled

bit

1 = Full-text is enabled for the database

0 = Full-text is disabled for the database

is_trustworthy_on

bit

1 = Database has been marked trustworthy

0 = Database has not been marked trustworthy

is_db_chaining_on

bit

1 = Cross-database ownership chaining is ON

0 = Cross-database ownership chaining is OFF

is_parameterization_forced

bit

1 = Parameterization is FORCED

0 = Parameterization is SIMPLE

is_master_key_encrypted_by_server

bit

1 = Database has an encrypted master key

0 = Database does not have an encrypted master key

is_published

bit

1 = Database is a publication database in a transactional or snapshot replication topology

0 = Is not a publication database

is_subscribed

bit

1 = Database is a subscription database in a replication topology

0 = Is not a subscription database

is_merge_published

bit

1 = Database is a publication database in a merge replication topology

0 = Is not a publication database in a merge replication topology

is_distributor

bit

1 = Database is the distribution database for a replication topology

0 = Is not the distribution database for a replication topology

is_sync_with_backup

bit

1 = Database is marked for replication synchronization with backup

0 = Is not marked for replication synchronization with backup

service_broker_guid

uniqueidentifier

Identifier of the service broker for this database. Used as the broker_instance of the target in the routing table.

is_broker_enabled

bit

1 = The broker in this database is currently sending and receiving messages.

0 = All sent messages will stay on the transmission queue and received messages will not be put on queues in this database.

By default, restored or attached databases have the broker disabled. The exception to this is database mirroring where the broker is enabled after failover.

log_reuse_wait

tinyint

0 = Nothing

log_reuse_wait_desc

nvarchar(60)

NOTHING

is_date_correlation_on

bit

1 = DATE_CORRELATION_OPTIMIZATION is ON

0 = DATE_CORRELATION_OPTIMIZATION is OFF

is_cdc_enabled

bit

1 = Database is enabled for change data capture.

is_encrypted

bit

Indicates whether the database is encrypted. Can be one of the following values:

1 = Encrypted

0 = Not Encrypted

If the database is in the process of being decrypted, is_encrypted shows a value of 0.

is_honor_broker_priority_on

bit

Indicates whether the database honors conversation priorities. Can be one of the following values:

1 = HONOR_BROKER_PRIORITY is ON

0 = HONOR_BROKER_PRIORITY is OFF

replica_id

uniqueidentifier

Unique identifier of the local AlwaysOn availability replica of the availability group, if any, in which the database is participating.

NULL = database is not part of an availability replica of in availability group.

group_database_id

uniqueidentifier

Unique identifier of the database within an AlwaysOn availability group, if any, in which the database is participating. group_database_id is the same for this database on the primary replica and on every secondary replica on which the database has been joined to the availability group.

NULL = database is not part of an availability replica in any availability group.

default_language_lcid

smallint

Indicates the local id (lcid) of the default language of a contained database.

This value is null for a non-contained database.

default_language_name

nvarchar(128)

Indicates the default language of a contained database.

This value is null for a non-contained database.

default_fulltext_language_lcid

int

Indicates the local id (lcid) of the default fulltext language of the contained database.

This value is null for a non-contained database.

default_fulltext_language_name

nvarchar(128)

Indicates the default fulltext language of the contained database.

This value is null for a non-contained database.

is_nested_triggers_on

bit

Indicates whether or not nested triggers are allowed in the contained database.

0 = nested triggers are not allowed

1 = nested triggers are allowed

This value is null for a non-contained database.

is_transform_noise_words_on

bit

Indicates whether or noise words should be transformed in the contained database.

0 = noise words should not be transformed.

1 = noise words should be transformed.

This value is null for a non-contained database.

two_digit_year_cutoff

smallint

Indicates a value of a number between 1753 and 9999 to represent the cutoff year for interpreting two-digit years as four-digit years.

This value is null for a non-contained database.

containment

tinyint not null

Indicates the containment status of the database.

0 = database containment is off

1 = database is in partial containment

2 = database is in full containment

containment_desc

nvarchar(60) not null

Indicates the containment status of the database.

NONE = legacy database (zero containment)

PARTIAL = partially contained database

FULL = fully contained database

target_recovery_time_in_seconds

int

The estimated time to recover the database, in seconds. Nullable.

Is_Federation_Member

boolean

Specifies whether the database is a member of federation.

ImportantImportant
The current implementation of Federations will be retired with Web and Business service tiers. Consider deploying custom sharding solutions to maximize scalability, flexibility, and performance. For more information about custom sharding, see Scaling Out Azure SQL Databases.

This view is available in the master database and user databases. In a master database, this view will return the information on the master database and all user databases on the server. In a user database, this view returns information only on the current database and the master database.

Use the sys.databases view in the master database of the Azure SQL Database server where the new database is being created.

After the database copy starts, you can query the sys.databases and sys.dm_database_copies views on the master database of the destination server to retrieve more information about the copying progress.

For more information about the sys.databases system view, see sys.databases (Transact-SQL) in SQL Server Books Online.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft