Class DatabasesAndFilesSchema.Database
- Namespace
- LinqToDB.Tools.DataProvider.SqlServer.Schemas
- Assembly
- linq2db.Tools.dll
sys.databases (Transact-SQL)
Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)
Contains one row per database in the instance of SQL Server.
If a database is not ONLINE
, or AUTO_CLOSE
is set to ON
and the database is closed, the values of some columns may be NULL
. If a database is OFFLINE
, the corresponding row is not visible to low-privileged users. To see the corresponding row if the database is OFFLINE
, a user must have at least the ALTER ANY DATABASE
server-level permission, or the CREATE DATABASE
permission in the master
database.
See sys.databases.
[Table(Schema = "sys", Name = "databases", IsView = true)]
public class DatabasesAndFilesSchema.Database
- Inheritance
-
DatabasesAndFilesSchema.Database
- Extension Methods
Properties
CatalogCollationType
The catalog collation setting:
0 = DATABASE_DEFAULT
2 = SQL_Latin_1_General_CP1_CI_AS
Applies to: Azure SQL Database
[Column("catalog_collation_type")]
[NotNull]
public int CatalogCollationType { get; set; }
Property Value
CatalogCollationTypeDesc
The catalog collation setting:
DATABASE_DEFAULT
SQL_Latin_1_General_CP1_CI_AS
Applies to: Azure SQL Database
[Column("catalog_collation_type_desc")]
[Nullable]
public string? CatalogCollationTypeDesc { get; set; }
Property Value
CollationName
Collation for the database. Acts as the default collation in the database.
NULL = Database is not online or AUTO_CLOSE is set to ON and the database is closed.
[Column("collation_name")]
[Nullable]
public string? CollationName { get; set; }
Property Value
CompatibilityLevel
Integer corresponding to the version of SQL Server for which behavior is compatible:
Value | Applies to |
70 | SQL Server 7.0 through SQL Server 2008 |
80 | SQL Server 2000 (8.x) through SQL Server 2008 R2 |
90 | SQL Server 2008 through SQL Server 2012 (11.x) |
100 | SQL Server (Starting with SQL Server 2008) and Azure SQL Database |
110 | SQL Server (Starting with SQL Server 2012 (11.x)) and Azure SQL Database |
120 | SQL Server (Starting with SQL Server 2014 (12.x)) and Azure SQL Database |
130 | SQL Server (Starting with SQL Server 2016 (13.x)) and Azure SQL Database |
140 | SQL Server (Starting with SQL Server 2017 (14.x)) and Azure SQL Database |
150 | SQL Server (Starting with SQL Server 2019 (15.x)) and Azure SQL Database |
[Column("compatibility_level")]
[NotNull]
public byte CompatibilityLevel { get; set; }
Property Value
Containment
Indicates the containment status of the database.
0 = database containment is off. Applies to: SQL Server (starting with SQL Server 2012 (11.x)) and Azure SQL Database
1 = database is in partial containment Applies to: SQL Server (starting with SQL Server 2012 (11.x))
[Column("containment")]
[Nullable]
public object? Containment { get; set; }
Property Value
ContainmentDesc
Indicates the containment status of the database.
NONE = legacy database (zero containment)
PARTIAL = partially contained database
Applies to: SQL Server (SQL Server 2012 (11.x) and later) and Azure SQL Database
[Column("containment_desc")]
[Nullable]
public string? ContainmentDesc { get; set; }
Property Value
CreateDate
Date the database was created or renamed. For tempdb, this value changes every time the server restarts.
[Column("create_date")]
[NotNull]
public DateTime CreateDate { get; set; }
Property Value
DatabaseID
ID of the database, unique within an instance of SQL Server or within a Azure SQL Database server.
[Column("database_id")]
[NotNull]
public int DatabaseID { get; set; }
Property Value
DefaultFulltextLanguageLcid
Indicates the locale id (lcid) of the default fulltext language of the contained database.
Note: Functions as the default Configure the default full-text language Server Configuration Option of sp_configure
. This value is null for a non-contained database.
Applies to: SQL Server (starting with SQL Server 2012 (11.x)) and Azure SQL Database
[Column("default_fulltext_language_lcid")]
[Nullable]
public int? DefaultFulltextLanguageLcid { get; set; }
Property Value
- int?
DefaultFulltextLanguageName
Indicates the default fulltext language of the contained database.
This value is null for a non-contained database.
Applies to: SQL Server (starting with SQL Server 2012 (11.x)) and Azure SQL Database
[Column("default_fulltext_language_name")]
[Nullable]
public string? DefaultFulltextLanguageName { get; set; }
Property Value
DefaultLanguageLcid
Indicates the local id (lcid) of the default language of a contained database.
Note: Functions as the Configure the default language Server Configuration Option of sp_configure
. This value is null for a non-contained database.
Applies to: SQL Server (starting with SQL Server 2012 (11.x)) and Azure SQL Database
[Column("default_language_lcid")]
[Nullable]
public short? DefaultLanguageLcid { get; set; }
Property Value
DefaultLanguageName
Indicates the default language of a contained database.
This value is null for a non-contained database.
Applies to: SQL Server (SQL Server 2012 (11.x) and later) and Azure SQL Database
[Column("default_language_name")]
[Nullable]
public string? DefaultLanguageName { get; set; }
Property Value
DelayedDurability
The delayed durability setting:
0 = DISABLED
1 = ALLOWED
2 = FORCED
For more information, see Control Transaction Durability.
Applies to: SQL Server (starting with SQL Server 2014 (12.x)) and Azure SQL Database.
[Column("delayed_durability")]
[Nullable]
public int? DelayedDurability { get; set; }
Property Value
- int?
DelayedDurabilityDesc
The delayed durability setting:
DISABLED
ALLOWED
FORCED
Applies to: SQL Server (starting with SQL Server 2014 (12.x)) and Azure SQL Database.
[Column("delayed_durability_desc")]
[Nullable]
public string? DelayedDurabilityDesc { get; set; }
Property Value
GroupDatabaseID
Unique identifier of the database within an Always On 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.
Applies to: SQL Server (starting with SQL Server 2012 (11.x)) and Azure SQL Database
[Column("group_database_id")]
[Nullable]
public Guid? GroupDatabaseID { get; set; }
Property Value
- Guid?
IsAcceleratedDatabaseRecoveryOn
Indicates whether Accelerated Database Recovery (ADR) is enabled.
1 = ADR is enabled
0 = ADR is disabled
Applies to: SQL Server (starting with SQL Server 2019 (15.x)) and Azure SQL Database
[Column("is_accelerated_database_recovery_on")]
[Nullable]
public bool? IsAcceleratedDatabaseRecoveryOn { get; set; }
Property Value
- bool?
IsAnsiNullDefaultOn
1 = ANSI_NULL_DEFAULT is ON
0 = ANSI_NULL_DEFAULT is OFF
[Column("is_ansi_null_default_on")]
[Nullable]
public bool? IsAnsiNullDefaultOn { get; set; }
Property Value
- bool?
IsAnsiNullsOn
1 = ANSI_NULLS is ON
0 = ANSI_NULLS is OFF
[Column("is_ansi_nulls_on")]
[Nullable]
public bool? IsAnsiNullsOn { get; set; }
Property Value
- bool?
IsAnsiPaddingOn
1 = ANSI_PADDING is ON
0 = ANSI_PADDING is OFF
[Column("is_ansi_padding_on")]
[Nullable]
public bool? IsAnsiPaddingOn { get; set; }
Property Value
- bool?
IsAnsiWarningsOn
1 = ANSI_WARNINGS is ON
0 = ANSI_WARNINGS is OFF
[Column("is_ansi_warnings_on")]
[Nullable]
public bool? IsAnsiWarningsOn { get; set; }
Property Value
- bool?
IsArithabortOn
1 = ARITHABORT is ON
0 = ARITHABORT is OFF
[Column("is_arithabort_on")]
[Nullable]
public bool? IsArithabortOn { get; set; }
Property Value
- bool?
IsAutoCloseOn
1 = AUTO_CLOSE is ON
0 = AUTO_CLOSE is OFF
[Column("is_auto_close_on")]
[NotNull]
public bool IsAutoCloseOn { get; set; }
Property Value
IsAutoCreateStatsIncrementalOn
Indicates the default setting for the incremental option of auto stats.
0 = auto create stats are non-incremental
1 = auto create stats are incremental if possible
Applies to: SQL Server (starting with SQL Server 2014 (12.x)).
[Column("is_auto_create_stats_incremental_on")]
[Nullable]
public bool? IsAutoCreateStatsIncrementalOn { get; set; }
Property Value
- bool?
IsAutoCreateStatsOn
1 = AUTO_CREATE_STATISTICS is ON
0 = AUTO_CREATE_STATISTICS is OFF
[Column("is_auto_create_stats_on")]
[Nullable]
public bool? IsAutoCreateStatsOn { get; set; }
Property Value
- bool?
IsAutoShrinkOn
1 = AUTO_SHRINK is ON
0 = AUTO_SHRINK is OFF
[Column("is_auto_shrink_on")]
[Nullable]
public bool? IsAutoShrinkOn { get; set; }
Property Value
- bool?
IsAutoUpdateStatsAsyncOn
1 = AUTO_UPDATE_STATISTICS_ASYNC is ON
0 = AUTO_UPDATE_STATISTICS_ASYNC is OFF
[Column("is_auto_update_stats_async_on")]
[Nullable]
public bool? IsAutoUpdateStatsAsyncOn { get; set; }
Property Value
- bool?
IsAutoUpdateStatsOn
1 = AUTO_UPDATE_STATISTICS is ON
0 = AUTO_UPDATE_STATISTICS is OFF
[Column("is_auto_update_stats_on")]
[Nullable]
public bool? IsAutoUpdateStatsOn { get; set; }
Property Value
- bool?
IsBrokerEnabled
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.
[Column("is_broker_enabled")]
[NotNull]
public bool IsBrokerEnabled { get; set; }
Property Value
IsCdcEnabled
1 = Database is enabled for change data capture. For more information, see sys.sp_cdc_enable_db (Transact-SQL).
[Column("is_cdc_enabled")]
[NotNull]
public bool IsCdcEnabled { get; set; }
Property Value
IsCleanlyShutdown
1 = Database shut down cleanly; no recovery required on startup
0 = Database did not shut down cleanly; recovery is required on startup
[Column("is_cleanly_shutdown")]
[Nullable]
public bool? IsCleanlyShutdown { get; set; }
Property Value
- bool?
IsConcatNullYieldsNullOn
1 = CONCAT_NULL_YIELDS_NULL is ON
0 = CONCAT_NULL_YIELDS_NULL is OFF
[Column("is_concat_null_yields_null_on")]
[Nullable]
public bool? IsConcatNullYieldsNullOn { get; set; }
Property Value
- bool?
IsCursorCloseOnCommitOn
1 = CURSOR_CLOSE_ON_COMMIT is ON
0 = CURSOR_CLOSE_ON_COMMIT is OFF
[Column("is_cursor_close_on_commit_on")]
[Nullable]
public bool? IsCursorCloseOnCommitOn { get; set; }
Property Value
- bool?
IsDateCorrelationOn
1 = DATE_CORRELATION_OPTIMIZATION is ON
0 = DATE_CORRELATION_OPTIMIZATION is OFF
[Column("is_date_correlation_on")]
[NotNull]
public bool IsDateCorrelationOn { get; set; }
Property Value
IsDbChainingOn
1 = Cross-database ownership chaining is ON
0 = Cross-database ownership chaining is OFF
[Column("is_db_chaining_on")]
[Nullable]
public bool? IsDbChainingOn { get; set; }
Property Value
- bool?
IsDistributor
1 = Database is the distribution database for a replication topology
0 = Is not the distribution database for a replication topology
[Column("is_distributor")]
[NotNull]
public bool IsDistributor { get; set; }
Property Value
IsEncrypted
Indicates whether the database is encrypted (reflects the state last set by using the ALTER DATABASE SET ENCRYPTION
clause). Can be one of the following values:
1 = Encrypted
0 = Not Encrypted
For more information about database encryption, see Transparent Data Encryption (TDE).
If the database is in the process of being decrypted, is_encrypted
shows a value of 0. You can see the state of the encryption process by using the sys.dm_database_encryption_keys dynamic management view.
[Column("is_encrypted")]
[Nullable]
public bool? IsEncrypted { get; set; }
Property Value
- bool?
IsFederationMember
Indicates if the database is a member of a federation.
Applies to: Azure SQL Database
[Column("is_federation_member")]
[Nullable]
public bool? IsFederationMember { get; set; }
Property Value
- bool?
IsFulltextEnabled
1 = Full-text is enabled for the database
0 = Full-text is disabled for the database
[Column("is_fulltext_enabled")]
[Nullable]
public bool? IsFulltextEnabled { get; set; }
Property Value
- bool?
IsHonorBrokerPriorityOn
Indicates whether the database honors conversation priorities (reflects the state last set by using the ALTER DATABASE SET HONOR_BROKER_PRIORITY
clause). Can be one of the following values:
1 = HONOR_BROKER_PRIORITY is ON
0 = HONOR_BROKER_PRIORITY is OFF
By default, restored or attached databases have the broker priority off.
[Column("is_honor_broker_priority_on")]
[Nullable]
public bool? IsHonorBrokerPriorityOn { get; set; }
Property Value
- bool?
IsInStandby
Database is read-only for restore log.
[Column("is_in_standby")]
[Nullable]
public bool? IsInStandby { get; set; }
Property Value
- bool?
IsLedgerOn
Indicates a ledger database, which is a database in which all user tables are ledger tables (all customer database is tamper-evident).
Applies to: Azure SQL Database
[Column("is_ledger_on")]
[NotNull]
public bool IsLedgerOn { get; set; }
Property Value
IsLocalCursorDefault
1 = CURSOR_DEFAULT is local
0 = CURSOR_DEFAULT is global
[Column("is_local_cursor_default")]
[Nullable]
public bool? IsLocalCursorDefault { get; set; }
Property Value
- bool?
IsMasterKeyEncryptedByServer
1 = Database has an encrypted master key
0 = Database does not have an encrypted master key
[Column("is_master_key_encrypted_by_server")]
[NotNull]
public bool IsMasterKeyEncryptedByServer { get; set; }
Property Value
IsMemoryOptimizedElevateToSnapshotOn
Memory-optimized tables are accessed using SNAPSHOT isolation when the session setting TRANSACTION ISOLATION LEVEL is set to a lower isolation level, READ COMMITTED or READ UNCOMMITTED.
1 = Minimum isolation level is SNAPSHOT.
0 = Isolation level is not elevated.
[Column("is_memory_optimized_elevate_to_snapshot_on")]
[Nullable]
public bool? IsMemoryOptimizedElevateToSnapshotOn { get; set; }
Property Value
- bool?
IsMemoryOptimizedEnabled
Indicates whether certain In-Memory features, such as Hybrid Buffer Pool, are enabled for the database. Does not reflect the availability or configuration state of In-Memory OLTP.
1 = memory-optimized features are enabled
0 = memory-optimized features are disabled
Applies to: SQL Server (starting with SQL Server 2019 (15.x)) and Azure SQL Database
[Column("is_memory_optimized_enabled")]
[Nullable]
public bool? IsMemoryOptimizedEnabled { get; set; }
Property Value
- bool?
IsMergePublished
1 = Database is a publication database in a merge replication topology
0 = Is not a publication database in a merge replication topology
[Column("is_merge_published")]
[NotNull]
public bool IsMergePublished { get; set; }
Property Value
IsMixedPageAllocationOn
Indicates whether tables and indexes in the database can allocate initial pages from mixed extents.
0 = Tables and indexes in the database always allocate initial pages from uniform extents.
1 = Tables and indexes in the database can allocate initial pages from mixed extents.
For more information, see the SET MIXED_PAGE_ALLOCATION
option of ALTER DATABASE SET Options (Transact-SQL).
Applies to: SQL Server (starting with SQL Server 2016 (13.x))
[Column("is_mixed_page_allocation_on")]
[Nullable]
public bool? IsMixedPageAllocationOn { get; set; }
Property Value
- bool?
IsNestedTriggersOn
Indicates whether or not nested triggers are allowed in the contained database.
0 = nested triggers are not allowed
1 = nested triggers are allowed
Note: Functions as the Configure the nested triggers Server Configuration Option of sp_configure
. This value is null for a non-contained database. See sys.configurations (Transact-SQL) for further information.
Applies to: SQL Server (starting with SQL Server 2012 (11.x)) and Azure SQL Database
[Column("is_nested_triggers_on")]
[Nullable]
public bool? IsNestedTriggersOn { get; set; }
Property Value
- bool?
IsNumericRoundabortOn
1 = NUMERIC_ROUNDABORT is ON
0 = NUMERIC_ROUNDABORT is OFF
[Column("is_numeric_roundabort_on")]
[Nullable]
public bool? IsNumericRoundabortOn { get; set; }
Property Value
- bool?
IsParameterizationForced
1 = Parameterization is FORCED
0 = Parameterization is SIMPLE
[Column("is_parameterization_forced")]
[Nullable]
public bool? IsParameterizationForced { get; set; }
Property Value
- bool?
IsPublished
1 = Database is a publication database in a transactional or snapshot replication topology
0 = Is not a publication database
[Column("is_published")]
[NotNull]
public bool IsPublished { get; set; }
Property Value
IsQueryStoreOn
1 = The query store is enable for this database. Check sys.database_query_store_options to view the query store status.
0 = The query store is not enabled
Applies to: SQL Server (starting with SQL Server 2016 (13.x)).
[Column("is_query_store_on")]
[Nullable]
public bool? IsQueryStoreOn { get; set; }
Property Value
- bool?
IsQuotedIdentifierOn
1 = QUOTED_IDENTIFIER is ON
0 = QUOTED_IDENTIFIER is OFF
[Column("is_quoted_identifier_on")]
[Nullable]
public bool? IsQuotedIdentifierOn { get; set; }
Property Value
- bool?
IsReadCommittedSnapshotOn
1 = READ_COMMITTED_SNAPSHOT option is ON. Read operations under the read-committed isolation level are based on snapshot scans and do not acquire locks.
0 = READ_COMMITTED_SNAPSHOT option is OFF (default). Read operations under the read-committed isolation level use share locks.
[Column("is_read_committed_snapshot_on")]
[Nullable]
public bool? IsReadCommittedSnapshotOn { get; set; }
Property Value
- bool?
IsReadOnly
1 = Database is READ_ONLY
0 = Database is READ_WRITE
[Column("is_read_only")]
[Nullable]
public bool? IsReadOnly { get; set; }
Property Value
- bool?
IsRecursiveTriggersOn
1 = RECURSIVE_TRIGGERS is ON
0 = RECURSIVE_TRIGGERS is OFF
[Column("is_recursive_triggers_on")]
[Nullable]
public bool? IsRecursiveTriggersOn { get; set; }
Property Value
- bool?
IsRemoteDataArchiveEnabled
Indicates whether the database is stretched.
0 = The database is not Stretch-enabled.
1 = The database is Stretch-enabled.
Applies to: SQL Server (starting with SQL Server 2016 (13.x))
For more information, see Stretch Database.
[Column("is_remote_data_archive_enabled")]
[Nullable]
public bool? IsRemoteDataArchiveEnabled { get; set; }
Property Value
- bool?
IsResultSetCachingOn
Indicates whether result set caching is enabled.
1 = result set caching is enabled
0 = result set caching is disabled
Applies to: Azure Synapse Analytics Gen2. While this feature is being rolled out to all regions, please check the version deployed to your instance and the latest Azure Synapse release notes and Gen2 upgrade schedule for feature availability.
[Column("is_result_set_caching_on")]
[Nullable]
public bool? IsResultSetCachingOn { get; set; }
Property Value
- bool?
IsStalePageDetectionOn
Indicates whether stale page detection is enabled.
1 = stale page detection is enabled
0 = stale page detection is disabled
Applies to: Azure Synapse Analytics Gen2. While this feature is being rolled out to all regions, please check the version deployed to your instance and the latest Azure Synapse release notes and Gen2 upgrade schedule for feature availability.
[Column("is_stale_page_detection_on")]
[Nullable]
public bool? IsStalePageDetectionOn { get; set; }
Property Value
- bool?
IsSubscribed
This column is not used. It will always return 0, regardless of the subscriber status of the database.
[Column("is_subscribed")]
[NotNull]
public bool IsSubscribed { get; set; }
Property Value
IsSupplementalLoggingEnabled
1 = SUPPLEMENTAL_LOGGING is ON
0 = SUPPLEMENTAL_LOGGING is OFF
[Column("is_supplemental_logging_enabled")]
[Nullable]
public bool? IsSupplementalLoggingEnabled { get; set; }
Property Value
- bool?
IsSyncWithBackup
1 = Database is marked for replication synchronization with backup
0 = Is not marked for replication synchronization with backup
[Column("is_sync_with_backup")]
[NotNull]
public bool IsSyncWithBackup { get; set; }
Property Value
IsTempdbSpillToRemoteStore
Indicates whether tempdb spill to remote store is enabled.
1 = enabled
0 = disabled
Applies to: Azure Synapse Analytics Gen2. While this feature is being rolled out to all regions, please check the version deployed to your instance and the latest Azure Synapse release notes and Gen2 upgrade schedule for feature availability.
[Column("is_tempdb_spill_to_remote_store")]
[Nullable]
public bool? IsTempdbSpillToRemoteStore { get; set; }
Property Value
- bool?
IsTemporalHistoryRetentionEnabled
Indicates whether temporal retention policy cleanup task is enabled.
1 = temporal retention is enabled
0 = temporal retention is disabled
Applies to: SQL Server (starting with SQL Server 2017 (14.x)) and Azure SQL Database
[Column("is_temporal_history_retention_enabled")]
[Nullable]
public bool? IsTemporalHistoryRetentionEnabled { get; set; }
Property Value
- bool?
IsTransformNoiseWordsOn
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.
Note: Functions as the transform noise words Server Configuration Option of sp_configure
. This value is null for a non-contained database. See sys.configurations (Transact-SQL) for further information.
Applies to: SQL Server (starting with SQL Server 2012 (11.x))
[Column("is_transform_noise_words_on")]
[Nullable]
public bool? IsTransformNoiseWordsOn { get; set; }
Property Value
- bool?
IsTrustworthyOn
1 = Database has been marked trustworthy
0 = Database has not been marked trustworthy
By default, restored or attached databases have the trustworthy not enabled.
[Column("is_trustworthy_on")]
[Nullable]
public bool? IsTrustworthyOn { get; set; }
Property Value
- bool?
LogReuseWait
Reuse of transaction log space is currently waiting on one of the following as of the last checkpoint. For more detailed explanations of these values, see The Transaction Log.
Value
0 = Nothing
1 = Checkpoint (When a database has a memory-optimized data filegroup, you should expect to see the log_reuse_wait
column indicate checkpoint
or xtp_checkpoint
) 1
2 = Log Backup 1
3 = Active backup or restore 1
4 = Active transaction 1
5 = Database mirroring 1
6 = Replication 1
7 = Database snapshot creation 1
8 = Log scan
9 = An Always On Availability Groups secondary replica is applying transaction log records of this database to a corresponding secondary database. 2
9 = Other (Transient) 3
10 = For internal use only 2
11 = For internal use only 2
12 = For internal use only 2
13 = Oldest page 2
14 = Other 2
16 = XTP_CHECKPOINT (When a database has a memory-optimized data filegroup, you should expect to see the log_reuse_wait
column indicate checkpoint
or xtp_checkpoint
) 4
17 = sLog scanning when Accelerated Database Recovery is used 5
1 Applies to: SQL Server (starting with SQL Server 2008)
2 Applies to: SQL Server (starting with SQL Server 2012 (11.x))
3 Applies to: SQL Server (up to, and including SQL Server 2008 R2)
4 Applies to: SQL Server (starting with SQL Server 2014 (12.x))
5 Applies to: SQL Server (starting with SQL Server 2019 (15.x))
[Column("log_reuse_wait")]
[Nullable]
public byte? LogReuseWait { get; set; }
Property Value
- byte?
LogReuseWaitDesc
Description of reuse of transaction log space is currently waiting on as of the last checkpoint. Possible values:
NOTHING
CHECKPOINT
LOG_BACKUP
ACTIVE_BACKUP_OR_RESTORE
ACTIVE_TRANSACTION
DATABASE_MIRRORING
REPLICATION
DATABASE_SNAPSHOT_CREATION
LOG_SCAN
AVAILABILITY_REPLICA
OLDEST_PAGE
XTP_CHECKPOINT
SLOG_SCAN
[Column("log_reuse_wait_desc")]
[Nullable]
public string? LogReuseWaitDesc { get; set; }
Property Value
Name
Name of database, unique within an instance of SQL Server or within a Azure SQL Database server.
[Column("name")]
[Nullable]
public string? Name { get; set; }
Property Value
OwnerSID
SID (Security-Identifier) of the external owner of the database, as registered to the server. For information about who can own a database, see the ALTER AUTHORIZATION for databases section of ALTER AUTHORIZATION.
[Column("owner_sid")]
[Nullable]
public byte[]? OwnerSID { get; set; }
Property Value
- byte[]
PageVerifyOption
Setting of PAGE_VERIFY option:
0 = NONE
1 = TORN_PAGE_DETECTION
2 = CHECKSUM
[Column("page_verify_option")]
[Nullable]
public byte? PageVerifyOption { get; set; }
Property Value
- byte?
PageVerifyOptionDesc
Description of PAGE_VERIFY option setting.
[Column("page_verify_option_desc")]
[Nullable]
public string? PageVerifyOptionDesc { get; set; }
Property Value
PhysicalDatabaseName
For SQL Server, the physical name of the database. For Azure SQL Database, a common id for the databases on a server.
Applies to: SQL Server (starting with SQL Server 2019 (15.x)) and Azure SQL Database
[Column("physical_database_name")]
[Nullable]
public string? PhysicalDatabaseName { get; set; }
Property Value
RecoveryModel
Recovery model selected:
1 = FULL
2 = BULK_LOGGED
3 = SIMPLE
[Column("recovery_model")]
[Nullable]
public byte? RecoveryModel { get; set; }
Property Value
- byte?
RecoveryModelDesc
Description of recovery model selected.
[Column("recovery_model_desc")]
[Nullable]
public string? RecoveryModelDesc { get; set; }
Property Value
ReplicaID
Unique identifier of the local Always On availability groups 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.
Applies to: SQL Server (SQL Server 2012 (11.x) and later) and Azure SQL Database
[Column("replica_id")]
[Nullable]
public Guid? ReplicaID { get; set; }
Property Value
- Guid?
ResourcePoolID
The id of the resource pool that is mapped to this database. This resource pool controls total memory available to memory-optimized tables in this database.
Applies to: SQL Server (starting with SQL Server 2014 (12.x))
[Column("resource_pool_id")]
[Nullable]
public int? ResourcePoolID { get; set; }
Property Value
- int?
ServiceBrokerGuid
Identifier of the service broker for this database. Used as the broker_instance of the target in the routing table.
[Column("service_broker_guid")]
[NotNull]
public Guid ServiceBrokerGuid { get; set; }
Property Value
SnapshotIsolationState
State of snapshot-isolation transactions being allowed, as set by the ALLOW_SNAPSHOT_ISOLATION option:
0 = Snapshot isolation state is OFF (default). Snapshot isolation is disallowed.
1 = Snapshot isolation state ON. Snapshot isolation is allowed.
2 = Snapshot isolation state is in transition to OFF state. All transactions have their modifications versioned. Cannot start new transactions using snapshot isolation. The database remains in the transition to OFF state until all transactions that were active when ALTER DATABASE was run can be completed.
3 = Snapshot isolation state is in transition to ON state. New transactions have their modifications versioned. Transactions cannot use snapshot isolation until the snapshot isolation state becomes 1 (ON). The database remains in the transition to ON state until all update transactions that were active when ALTER DATABASE was run can be completed.
[Column("snapshot_isolation_state")]
[Nullable]
public byte? SnapshotIsolationState { get; set; }
Property Value
- byte?
SnapshotIsolationStateDesc
Description of state of snapshot-isolation transactions being allowed, as set by the ALLOW_SNAPSHOT_ISOLATION option.
[Column("snapshot_isolation_state_desc")]
[Nullable]
public string? SnapshotIsolationStateDesc { get; set; }
Property Value
SourceDatabaseID
Non-NULL = ID of the source database of this database snapshot.
NULL = Not a database snapshot.
[Column("source_database_id")]
[Nullable]
public int? SourceDatabaseID { get; set; }
Property Value
- int?
State
Value
0 = ONLINE
1 = RESTORING
2 = RECOVERING 1
3 = RECOVERY_PENDING 1
4 = SUSPECT
5 = EMERGENCY 1
6 = OFFLINE 1
7 = COPYING 2
10 = OFFLINE_SECONDARY 2
Note: For Always On databases, query the database_state
or database_state_desc
columns of sys.dm_hadr_database_replica_states.
1 Applies to: SQL Server (starting with SQL Server 2008) and Azure SQL Database
2 Applies to: Azure SQL Database Active Geo-Replication
[Column("state")]
[Nullable]
public byte? State { get; set; }
Property Value
- byte?
StateDesc
Description of the database state. See state.
[Column("state_desc")]
[Nullable]
public string? StateDesc { get; set; }
Property Value
TargetRecoveryTimeInSeconds
The estimated time to recover the database, in seconds. Nullable.
Applies to: SQL Server (starting with SQL Server 2012 (11.x)) and Azure SQL Database
[Column("target_recovery_time_in_seconds")]
[Nullable]
public int? TargetRecoveryTimeInSeconds { get; set; }
Property Value
- int?
TwoDigitYearCutoff
Indicates a value of a number between 1753 and 9999 to represent the cutoff year for interpreting two-digit years as four-digit years.
Note: Functions as the Configure the two digit year cutoff Server Configuration Option of sp_configure
. This value is null for a non-contained database. See sys.configurations (Transact-SQL) for further information.
Applies to: SQL Server (starting with SQL Server 2012 (11.x)) and Azure SQL Database
[Column("two_digit_year_cutoff")]
[Nullable]
public short? TwoDigitYearCutoff { get; set; }
Property Value
UserAccess
User-access setting:
0 = MULTI_USER specified
1 = SINGLE_USER specified
2 = RESTRICTED_USER specified
[Column("user_access")]
[Nullable]
public byte? UserAccess { get; set; }
Property Value
- byte?
UserAccessDesc
Description of user-access setting.
[Column("user_access_desc")]
[Nullable]
public string? UserAccessDesc { get; set; }