Class DatabasesAndFilesSchema.DataContext
- Namespace
- LinqToDB.Tools.DataProvider.SqlServer.Schemas
- Assembly
- linq2db.Tools.dll
public class DatabasesAndFilesSchema.DataContext
- Inheritance
-
DatabasesAndFilesSchema.DataContext
- Extension Methods
Constructors
DataContext(IDataContext)
public DataContext(IDataContext dataContext)
Parameters
dataContext
IDataContext
Properties
BackupDevices
sys.backup_devices (Transact-SQL)
Applies to: √ SQL Server (all supported versions)
Contains a row for each backup-device registered by using sp_addumpdevice or created in SQL Server Management Studio.
See sys.backup_devices.
public ITable<DatabasesAndFilesSchema.BackupDevice> BackupDevices { get; }
Property Value
DatabaseAutomaticTuningModes
sys.database\_automatic\_tuning_mode (Transact-SQL)
Applies to: √ SQL Server 2017 (14.x) and later √ Azure SQL Database √ Azure SQL Managed Instance
Returns the Automatic Tuning mode for this database. Refer to ALTER DATABASE SET AUTOMATIC_TUNING (Transact-SQL) for available options.
public ITable<DatabasesAndFilesSchema.DatabaseAutomaticTuningMode> DatabaseAutomaticTuningModes { get; }
Property Value
DatabaseAutomaticTuningOptions
sys.database\_automatic\_tuning_options (Transact-SQL)
Applies to: √ SQL Server 2017 (14.x) and later √ Azure SQL Database √ Azure SQL Managed Instance
Returns the Automatic Tuning options for this database.
public ITable<DatabasesAndFilesSchema.DatabaseAutomaticTuningOption> DatabaseAutomaticTuningOptions { get; }
Property Value
DatabaseFiles
sys.database_files (Transact-SQL)
Applies to: √ SQL Server (all supported versions) √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics √ Analytics Platform System (PDW)
Contains a row per file of a database as stored in the database itself. This is a per-database view.
See sys.database_files.
public ITable<DatabasesAndFilesSchema.DatabaseFile> DatabaseFiles { get; }
Property Value
DatabaseMirrorings
sys.database_mirroring (Transact-SQL)
Applies to: √ SQL Server (all supported versions)
Contains one row for each database in the instance of SQL Server. If the database is not ONLINE or database mirroring is not enabled, the values of all columns except database_id will be NULL.
To see the row for a database other than master or tempdb, you must either be the database owner or have at least ALTER ANY DATABASE or VIEW ANY DATABASE server-level permission or CREATE DATABASE permission in the master database. To see non-NULL values on a mirror database, you must be a member of the sysadmin fixed server role.
note
If a database does not participate in mirroring, all columns prefixed with 'mirroring_' are NULL.
public ITable<DatabasesAndFilesSchema.DatabaseMirroring> DatabaseMirrorings { get; }
Property Value
DatabaseRecoveryStatus
sys.database_recovery_status (Transact-SQL)
Applies to: √ SQL Server (all supported versions)
Contains one row per database. If the database is not opened, the SQL Server Database Engine tries to start it.
To see the row for a database other than master or tempdb, one of the following must apply:
- Be the owner of the database.
- Have ALTER ANY DATABASE or VIEW ANY DATABASE server-level permissions.
- Have CREATE DATABASE permission in the master database.
public ITable<DatabasesAndFilesSchema.DatabaseRecoveryStatus> DatabaseRecoveryStatus { get; }
Property Value
DatabaseScopedConfigurations
sys.database_scoped_configurations (Transact-SQL)
APPLIES TO: (Yes) SQL Server 2016 and later (Yes) Azure SQL Database (Yes) Azure Synapse Analytics (No) Parallel Data Warehouse
Contains one row per configuration.
public ITable<DatabasesAndFilesSchema.DatabaseScopedConfiguration> DatabaseScopedConfigurations { get; }
Property Value
Databases
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.
public ITable<DatabasesAndFilesSchema.Database> Databases { get; }
Property Value
MasterFiles
sys.master_files (Transact-SQL)
Applies to: √ SQL Server (all supported versions) √ Azure SQL Managed Instance √ Analytics Platform System (PDW)
Contains a row per file of a database as stored in the master database. This is a single, system-wide view.
See sys.master_files.
public ITable<DatabasesAndFilesSchema.MasterFile> MasterFiles { get; }