Database Database Database Class

Definition

Represents an SQL Server database.

public ref class Database sealed : Microsoft::SqlServer::Management::Smo::ScriptNameObjectBase, Microsoft::SqlServer::Management::Common::IAlterable, Microsoft::SqlServer::Management::Common::ICreatable, Microsoft::SqlServer::Management::Common::IDropIfExists, Microsoft::SqlServer::Management::Common::IDroppable, Microsoft::SqlServer::Management::Common::IRenamable, Microsoft::SqlServer::Management::Sdk::Sfc::IDmfFacet, Microsoft::SqlServer::Management::Sdk::Sfc::ISfcSupportsDesignMode, Microsoft::SqlServer::Management::Smo::IDatabaseOptions, Microsoft::SqlServer::Management::Smo::IExtendedProperties, Microsoft::SqlServer::Management::Smo::IScriptable
[Microsoft.SqlServer.Management.Facets.EvaluationMode(Microsoft.SqlServer.Management.Dmf.AutomatedPolicyEvaluationMode.CheckOnSchedule)]
[Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcElement(Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcElementFlags.Standalone | Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcElementFlags.SqlAzureDatabase)]
[Microsoft.SqlServer.Management.Sdk.Sfc.PhysicalFacet]
public sealed class Database : Microsoft.SqlServer.Management.Smo.ScriptNameObjectBase, Microsoft.SqlServer.Management.Common.IAlterable, Microsoft.SqlServer.Management.Common.ICreatable, Microsoft.SqlServer.Management.Common.IDropIfExists, Microsoft.SqlServer.Management.Common.IDroppable, Microsoft.SqlServer.Management.Common.IRenamable, Microsoft.SqlServer.Management.Sdk.Sfc.IDmfFacet, Microsoft.SqlServer.Management.Sdk.Sfc.ISfcSupportsDesignMode, Microsoft.SqlServer.Management.Smo.IDatabaseOptions, Microsoft.SqlServer.Management.Smo.IExtendedProperties, Microsoft.SqlServer.Management.Smo.IScriptable
Public NotInheritable Class Database
Inherits ScriptNameObjectBase
Implements IAlterable, ICreatable, IDatabaseOptions, IDmfFacet, IDropIfExists, IDroppable, IExtendedProperties, IRenamable, IScriptable, ISfcSupportsDesignMode
Inheritance
Attributes
Microsoft.SqlServer.Management.Facets.EvaluationModeAttribute Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcElementAttribute PhysicalFacetAttribute
Implements
Microsoft.SqlServer.Management.Common.IAlterableMicrosoft.SqlServer.Management.Common.IAlterableMicrosoft.SqlServer.Management.Common.IAlterable Microsoft.SqlServer.Management.Common.ICreatableMicrosoft.SqlServer.Management.Common.ICreatableMicrosoft.SqlServer.Management.Common.ICreatable Microsoft.SqlServer.Management.Common.IDropIfExistsMicrosoft.SqlServer.Management.Common.IDropIfExistsMicrosoft.SqlServer.Management.Common.IDropIfExists Microsoft.SqlServer.Management.Common.IDroppableMicrosoft.SqlServer.Management.Common.IDroppableMicrosoft.SqlServer.Management.Common.IDroppable Microsoft.SqlServer.Management.Common.IRenamableMicrosoft.SqlServer.Management.Common.IRenamableMicrosoft.SqlServer.Management.Common.IRenamable IDmfFacetIDmfFacetIDmfFacet ISfcSupportsDesignModeISfcSupportsDesignModeISfcSupportsDesignMode IDatabaseOptionsIDatabaseOptionsIDatabaseOptions IExtendedPropertiesIExtendedPropertiesIExtendedProperties IScriptableIScriptableIScriptable

Examples

VB

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")  
$db = New-Object Microsoft.SqlServer.Management.Smo.Database($srv, "Test_SMO_Database")  
$db.Create()  
Write-Host $db.CreateDate  
$db.Drop()  

Remarks

The Database class represents databases, either system or user-defined, on the instance of SQL Server. The Server class is the parent of the Database class.

By using the Database class, you can do the following:

  • Create a new database or drop an existing database.

  • Register the database in the Active Directory service.

  • Reference database objects in collections, such as tables, users, and triggers.

  • Set up database mirroring.

  • Create a master database key.

  • Set up a full-text search catalog.

  • Check data, allocations, catalogs, and tables.

  • Issue a checkpoint.

  • Grant, revoke, and deny permissions to users on the database.

  • Run Transact-SQL statements.

  • Enumerate database information, such as locks or object permissions.

  • Remove the backup history.

  • Monitor the number of transactions.

  • Set the database offline or online.

  • Change the owner of the database.

  • Update statistics.

  • Shrink the database.

  • Truncate the log.

  • Script the database.

    To get Database object properties, a login must be a member of the public fixed server role and the user mapped to this login in the database must be a member of the public database role.

    To set Database object properties and run the Alter method, users must have ALTER permission on the database, or be a member of the db_owner fixed database role.

    To create a database, users must have CREATE DATABASE, CREATE ANY DATABASE, or ALTER ANY DATABASE permission on the parent server.

    To drop a database, users must have CONTROL permission on the database, or be a member of the db_owner fixed database role.

    To grant, revoke, or deny other users permission on the database, users must have CONTROL permission on the database or be a member of the db_owner fixed database role.

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Constructors

Database() Database() Database()

Initializes a new instance of the Database class.

Database(Server, String) Database(Server, String) Database(Server, String)

Initializes a new instance of the Database class on the specified server and with the specified name.

Properties

ActiveConnections ActiveConnections ActiveConnections

Gets the number of active connections to the database.

ActiveDirectory ActiveDirectory ActiveDirectory

Gets the information about the Active Directory settings for the database.

AnsiNullDefault AnsiNullDefault AnsiNullDefault

Gets or sets a value that specifies whether the ANSI_NULL_DEFAULT database option is active.

AnsiNullsEnabled AnsiNullsEnabled AnsiNullsEnabled

Gets or sets a value that specifies whether the ANSI_NULLS_ENABLED database option is active.

AnsiPaddingEnabled AnsiPaddingEnabled AnsiPaddingEnabled

Gets or sets a value that specifies whether the ANSI_PADDING_ENABLED database option is active.

AnsiWarningsEnabled AnsiWarningsEnabled AnsiWarningsEnabled

Gets or sets a value that specifies whether the ANSI_WARNINGS_ENABLED database option is active.

ApplicationRoles ApplicationRoles ApplicationRoles

Gets a collection of ApplicationRole objects. Each ApplicationRole object represents an application role defined on the database.

ArithmeticAbortEnabled ArithmeticAbortEnabled ArithmeticAbortEnabled

Gets or sets a value that specifies whether the ARITHMETICABORT database option is active.

Assemblies Assemblies Assemblies

Gets a collection of SqlAssembly objects. Each SqlAssembly object represents an assembly defined on the database.

AsymmetricKeys AsymmetricKeys AsymmetricKeys

Gets a collection of AsymmetricKey objects. Each AsymmetricKey object represents an asymmetric key defined on the database.

AutoClose AutoClose AutoClose

Gets or sets a value that specifies whether the AUTOCLOSE database option is set.

AutoCreateIncrementalStatisticsEnabled AutoCreateIncrementalStatisticsEnabled AutoCreateIncrementalStatisticsEnabled

Gets a value that specifies whether the incremental statistics are automatically created for the database.

AutoCreateStatisticsEnabled AutoCreateStatisticsEnabled AutoCreateStatisticsEnabled

Gets a value that specifies whether statistics are automatically created for the database.

AutoShrink AutoShrink AutoShrink

Gets or sets a value that specifies whether the AUTO_SHRINK database option is active.

AutoUpdateStatisticsAsync AutoUpdateStatisticsAsync AutoUpdateStatisticsAsync

Gets or sets a value that specifies whether the AUTOUPDATESTATISTICSASYNC database option is active.

AutoUpdateStatisticsEnabled AutoUpdateStatisticsEnabled AutoUpdateStatisticsEnabled

Gets or sets a value that specifies whether statistics are automatically updated for the database.

AvailabilityDatabaseSynchronizationState AvailabilityDatabaseSynchronizationState AvailabilityDatabaseSynchronizationState

Gets the synchronization state of the availability database.

AvailabilityGroupName AvailabilityGroupName AvailabilityGroupName

Gets the availability group name in the database.

AzureEdition AzureEdition AzureEdition

Gets the Azure edition of the database.

AzureServiceObjective AzureServiceObjective AzureServiceObjective

Gets the objective of the current subscription.

BrokerEnabled BrokerEnabled BrokerEnabled

Gets or sets a value that specifies whether the Service Broker service is enabled.

CaseSensitive CaseSensitive CaseSensitive

Gets a value that specifies whether uppercase letters and lowercase letters are evaluated as equal.

Certificates Certificates Certificates

Gets a collection of Certificate objects. Each Certificate object represents a certificate defined on the database.

ChangeTrackingAutoCleanUp ChangeTrackingAutoCleanUp ChangeTrackingAutoCleanUp

Gets or sets a value that specifies whether the CHANGE_TRACKING_AUTO_CLEANUP OPTION is enabled.

ChangeTrackingEnabled ChangeTrackingEnabled ChangeTrackingEnabled

Gets or sets a value that specifies whether the CHANGE_TRACKING_VALUE option is enabled.

ChangeTrackingRetentionPeriod ChangeTrackingRetentionPeriod ChangeTrackingRetentionPeriod

Gets or sets the CHANGE_TRACKING_RETENTION_PERIOD value.

ChangeTrackingRetentionPeriodUnits ChangeTrackingRetentionPeriodUnits ChangeTrackingRetentionPeriodUnits

Gets or sets the unit type for a retention period value.

CloseCursorsOnCommitEnabled CloseCursorsOnCommitEnabled CloseCursorsOnCommitEnabled

Gets or sets a value that specifies whether the CURSOR_CLOSE_ON_COMMIT database option is active.

Collation Collation Collation

Gets or sets the default collation used by the database.

ColumnEncryptionKeys ColumnEncryptionKeys ColumnEncryptionKeys

Gets a collection of column encryption keys.

ColumnMasterKeys ColumnMasterKeys ColumnMasterKeys

Gets or sets the Column MasterKeys.

CompatibilityLevel CompatibilityLevel CompatibilityLevel

Gets or sets the compatibility level for the database.

ConcatenateNullYieldsNull ConcatenateNullYieldsNull ConcatenateNullYieldsNull

Gets or sets a value that specifies whether the CONCAT_NULL_YIELDS_NULL database option is active.

ContainmentType ContainmentType ContainmentType

Gets or sets the type of containment.

CreateDate CreateDate CreateDate

Gets the date that the database was created.

DatabaseAuditSpecifications DatabaseAuditSpecifications DatabaseAuditSpecifications

Gets a collection of DatabaseAuditSpecification objects. Each DatabaseAuditSpecification object represents a database audit specification defined on the server.

DatabaseEncryptionKey DatabaseEncryptionKey DatabaseEncryptionKey

Gets a DataBaseEncryptionKey data type.

DatabaseGuid DatabaseGuid DatabaseGuid

Gets the Guid value that uniquely identifies the database.

DatabaseOptions DatabaseOptions DatabaseOptions

Gets the DatabaseOptions object that contains configuration options for the database.

DatabaseOwnershipChaining DatabaseOwnershipChaining DatabaseOwnershipChaining

Gets or sets a value that specifies whether the database ownership chaining is active.

DatabaseScopedCredentials DatabaseScopedCredentials DatabaseScopedCredentials

Gets the database scoped credential collection.

DatabaseSnapshotBaseName DatabaseSnapshotBaseName DatabaseSnapshotBaseName

Gets the name of the snapshot base for the database.

DataSpaceUsage DataSpaceUsage DataSpaceUsage

Gets the space used by the data in the database.

DateCorrelationOptimization DateCorrelationOptimization DateCorrelationOptimization

Gets or sets a value that specifies whether the date correlation optimization is active.

DboLogin DboLogin DboLogin

Gets a value that specifies whether the current user is logged on as the database owner (DBO).

DefaultFileGroup DefaultFileGroup DefaultFileGroup

Gets the default file group used by the database.

DefaultFileStreamFileGroup DefaultFileStreamFileGroup DefaultFileStreamFileGroup

Gets the file group name for the default file stream.

DefaultFullTextCatalog DefaultFullTextCatalog DefaultFullTextCatalog

Gets the default full-text catalog used by the database.

DefaultFullTextLanguage DefaultFullTextLanguage DefaultFullTextLanguage

Gets the default full text language.

DefaultLanguage DefaultLanguage DefaultLanguage

Gets or sets the default language.

Defaults Defaults Defaults

Gets a collection of Default objects. Each Default object represents a default defined on the database.

DefaultSchema DefaultSchema DefaultSchema

Gets the default schema of the user.

DelayedDurability DelayedDurability DelayedDurability

Gets or sets the delayed durability setting of a database.

EncryptionEnabled EncryptionEnabled EncryptionEnabled

Gets or sets a value that indicates whether the data encryption is enabled.

Events Events Events

Gets the events associated with the database.

ExecuteForScalar ExecuteForScalar ExecuteForScalar

Gets or sets the Boolean property value that specifies whether the object is set to the execute for scalar option.

(Inherited from SqlSmoObject)
ExecutionManager ExecutionManager ExecutionManager

Gets the execution manager.

ExtendedProperties ExtendedProperties ExtendedProperties

Gets the extended properties of the database.

ExtendedStoredProcedures ExtendedStoredProcedures ExtendedStoredProcedures

Gets a collection of ExtendedStoredProcedure objects. Each ExtendedStoredProcedure object represents an extended stored procedure defined on the database.

ExternalDataSources ExternalDataSources ExternalDataSources

Gets the collection of external data source.

ExternalFileFormats ExternalFileFormats ExternalFileFormats

Gets a collection of external file formats.

Federations Federations Federations

Gets a collection of Federation objects. Each Federation represents a data being partitioned on the database.

FileGroups FileGroups FileGroups

Gets a collection of FileGroup objects. Each FileGroup object represents a file group defined on the database.

FilestreamDirectoryName FilestreamDirectoryName FilestreamDirectoryName

Gets or sets the name of file stream share directory.

FilestreamNonTransactedAccess FilestreamNonTransactedAccess FilestreamNonTransactedAccess

Gets or sets the file stream non-transacted access setting for database.

FullTextCatalogs FullTextCatalogs FullTextCatalogs

Gets a collection of FullTextCatalog objects. Each FullTextCatalog object represents a full-text catalog defined on the database.

FullTextStopLists FullTextStopLists FullTextStopLists

Gets a collection of FullTextStopList objects. Each FullTextStopList object represents a full text stop list defined on the server.

HasFileInCloud HasFileInCloud HasFileInCloud

Gets a value that indicates whether the database has file in Cloud database.

HasMemoryOptimizedObjects HasMemoryOptimizedObjects HasMemoryOptimizedObjects

Gets the Boolean value that specifies whether the database contains memory optimized objects.

HonorBrokerPriority HonorBrokerPriority HonorBrokerPriority

Gets or sets a value that specifies whether the priority specified by the broker is acknowledged or not.

ID ID ID

Gets the database ID value that uniquely identifies the database.

IndexSpaceUsage IndexSpaceUsage IndexSpaceUsage

Gets the space used by the indexes in the database.

IsAccessible IsAccessible IsAccessible

Gets a value that specifies whether the database can be accessed.

IsDatabaseSnapshot IsDatabaseSnapshot IsDatabaseSnapshot

Gets a value that specifies whether the database is a snapshot database.

IsDatabaseSnapshotBase IsDatabaseSnapshotBase IsDatabaseSnapshotBase

Gets a value that specifies whether the database is the base database for a snapshot database.

IsDbAccessAdmin IsDbAccessAdmin IsDbAccessAdmin

Gets a value that specifies whether the current user is a member of the DbAccessAdmin database role.

IsDbBackupOperator IsDbBackupOperator IsDbBackupOperator

Gets a value that specifies whether the current user is a member of the DbBackupOperator database role.

IsDbDatareader IsDbDatareader IsDbDatareader

Gets a value that specifies whether the current user is a member of the DbDatareader database role.

IsDbDatawriter IsDbDatawriter IsDbDatawriter

Gets a value that specifies whether the current user is a member of the DbDatawriter database role.

IsDbDdlAdmin IsDbDdlAdmin IsDbDdlAdmin

Gets a value that specifies whether the current user is a member of the DbDdlAdmin database role.

IsDbDenyDatareader IsDbDenyDatareader IsDbDenyDatareader

Gets a value that specifies whether the current user is a member of the DbDenyDatareader database role.

IsDbDenyDatawriter IsDbDenyDatawriter IsDbDenyDatawriter

Gets a value that specifies whether the current member is a member of the DbDenyDatawriter database.

IsDbManager IsDbManager IsDbManager

Gets a value that specifies whether the current login is a database manager in SQL Database.

IsDbOwner IsDbOwner IsDbOwner

Gets a value that specifies whether the current user is a member of the DbOwner database role.

IsDbSecurityAdmin IsDbSecurityAdmin IsDbSecurityAdmin

Gets a value that specifies whether the current user is a member of the DbSecurityAdmin database role.

IsFederationMember IsFederationMember IsFederationMember

Gets or sets a value that specifies whether the database is a member of federation.

IsFullTextEnabled IsFullTextEnabled IsFullTextEnabled

Gets or sets a value that specifies whether the database is enabled for full-text search.

IsLoginManager IsLoginManager IsLoginManager

Gets a value that specifies whether the current login is a login manager in SQL Database.

IsMailHost IsMailHost IsMailHost

Gets a value that specifies whether the database is configured as a mail host.

IsManagementDataWarehouse IsManagementDataWarehouse IsManagementDataWarehouse

Gets a value that specifies whether the database is a management data warehouse.

IsMirroringEnabled IsMirroringEnabled IsMirroringEnabled

Gets a value that specifies whether mirroring is enabled on the database.

IsParameterizationForced IsParameterizationForced IsParameterizationForced

Gets or sets a value that specifies whether parameterization is forced on the database.

IsReadCommittedSnapshotOn IsReadCommittedSnapshotOn IsReadCommittedSnapshotOn

Gets or sets a value that specifies whether transactions with the read committed isolation level use row versioning.

IsSystemObject IsSystemObject IsSystemObject

Gets a value that specifies whether the database is a system object or a user-defined database.

IsTouched IsTouched IsTouched

Gets the Boolean property value that specifies whether the object properties have been updated but not yet persisted on the server.

(Inherited from SqlSmoObject)
IsUpdateable IsUpdateable IsUpdateable

Gets a value that specifies whether the database can be updated.

IsVarDecimalStorageFormatEnabled IsVarDecimalStorageFormatEnabled IsVarDecimalStorageFormatEnabled

Gets or sets a value that specifies whether VarDecimal storage is enabled.

LastBackupDate LastBackupDate LastBackupDate

Gets the date and time when the database was last backed up.

LastDifferentialBackupDate LastDifferentialBackupDate LastDifferentialBackupDate

Gets the date and time when the last differential backup was performed.

LastLogBackupDate LastLogBackupDate LastLogBackupDate

Gets the date and time when the transaction log was last backed up.

LocalCursorsDefault LocalCursorsDefault LocalCursorsDefault

Gets or sets a value that specifies whether the local server cursors are used by default.

LogFiles LogFiles LogFiles

Gets a collection of LogFile objects. Each LogFile object represents a log file defined on the database.

LogReuseWaitStatus LogReuseWaitStatus LogReuseWaitStatus

Gets the type of operation on which the reuse of transaction log space is waiting.

MasterKey MasterKey MasterKey

Gets the master key that is used to encrypt the private keys of certificates.

MemoryAllocatedToMemoryOptimizedObjectsInKB MemoryAllocatedToMemoryOptimizedObjectsInKB MemoryAllocatedToMemoryOptimizedObjectsInKB

Gets the memory (in kilobytes) allocated to memory-optimized objects in the database.

MemoryUsedByMemoryOptimizedObjectsInKB MemoryUsedByMemoryOptimizedObjectsInKB MemoryUsedByMemoryOptimizedObjectsInKB

Gets the memory used (in kilobytes) by memory-optimized objects in the database.

MirroringFailoverLogSequenceNumber MirroringFailoverLogSequenceNumber MirroringFailoverLogSequenceNumber

Gets the log sequence number at last failover.

MirroringID MirroringID MirroringID

Gets the ID value that uniquely identifies the mirroring partnership.

MirroringPartner MirroringPartner MirroringPartner

Gets or sets the address of the Database Engine instance that is the partner server for database mirroring.

MirroringPartnerInstance MirroringPartnerInstance MirroringPartnerInstance

Gets the instance of SQL Server on which the mirroring partner is configured.

MirroringRedoQueueMaxSize MirroringRedoQueueMaxSize MirroringRedoQueueMaxSize

Gets the maximum size of the redo queue of the mirror server instance in KB.

MirroringRoleSequence MirroringRoleSequence MirroringRoleSequence

Gets the role sequence number for primary/backup roles played by the mirroring partners.

MirroringSafetyLevel MirroringSafetyLevel MirroringSafetyLevel

Gets or sets the mirroring safety level.

MirroringSafetySequence MirroringSafetySequence MirroringSafetySequence

Gets the role sequence number for safety levels for the mirroring partners.

MirroringStatus MirroringStatus MirroringStatus

Gets the status of the database and the database mirroring session.

MirroringTimeout MirroringTimeout MirroringTimeout

Gets or sets the maximum time, in seconds, that the principal server instance waits for a PING message from another instance in the mirroring session before assuming the other instance is disconnected.

MirroringWitness MirroringWitness MirroringWitness

Gets or sets the name of the Database Engine instance of the database mirroring witness server.

MirroringWitnessStatus MirroringWitnessStatus MirroringWitnessStatus

Gets the status of the mirroring witness server.

Name Name Name

Gets or sets the name of the database.

NestedTriggersEnabled NestedTriggersEnabled NestedTriggersEnabled

Gets or sets a value that indicates whether the nested triggers are enabled.

NumericRoundAbortEnabled NumericRoundAbortEnabled NumericRoundAbortEnabled

Gets or sets a value that specifies whether the NUMERIC_ROUNDABORT database option is active.

ObjectInSpace ObjectInSpace ObjectInSpace

Gets the Boolean property value that specifies whether the object exists in isolation, or whether it is directly or indirectly connected to the instance of SQL Server.

(Inherited from SqlSmoObject)
Owner Owner Owner

Gets the database principal that is the owner of the database.

PageVerify PageVerify PageVerify

Gets or sets the type of page integrity check that SQL Server performs when reading database pages.

Parent Parent Parent

Gets or sets the Server object that is the parent of the Database object.

PartitionFunctions PartitionFunctions PartitionFunctions

Gets a collection of PartitionFunction objects. Each PartitionFunction object represents a partition function defined on the database.

PartitionSchemes PartitionSchemes PartitionSchemes

Gets a collection of PartitionScheme objects. Each PartitionScheme object represents a partition scheme defined on the database.

PlanGuides PlanGuides PlanGuides

Gets a collection of plan guides associated with a database.

PrimaryFilePath PrimaryFilePath PrimaryFilePath

Gets the operating system directory that contains the primary file for the database.

Properties Properties Properties

Gets a collection of Property objects that represent the object properties.

(Inherited from SqlSmoObject)
QueryStoreOptions QueryStoreOptions QueryStoreOptions

Gets the options for the query store.

QuotedIdentifiersEnabled QuotedIdentifiersEnabled QuotedIdentifiersEnabled

Gets or sets a value that specifies whether identifiers delimited by double quotation marks (" ") are Transact-SQL reserved keywords or contain characters not usually allowed by the Transact-SQL syntax rules.

ReadOnly ReadOnly ReadOnly

Gets or sets a value that specifies whether the database is read-only.

RecoveryForkGuid RecoveryForkGuid RecoveryForkGuid

Gets the GUID value that specifies the recovery fork on which the database is currently active.

RecoveryModel RecoveryModel RecoveryModel

Gets or sets the recovery model for the database.

RecursiveTriggersEnabled RecursiveTriggersEnabled RecursiveTriggersEnabled

Gets or sets a value that specifies whether recursive triggers are enabled on the database.

RemoteDataArchiveCredential RemoteDataArchiveCredential RemoteDataArchiveCredential

Gets or sets the remote data archive.

RemoteDataArchiveEnabled RemoteDataArchiveEnabled RemoteDataArchiveEnabled

Gets or sets a value that indicates whether remote data archive is enabled.

RemoteDataArchiveEndpoint RemoteDataArchiveEndpoint RemoteDataArchiveEndpoint

Gets or sets the remote data archive endpoint for the database.

RemoteDataArchiveLinkedServer RemoteDataArchiveLinkedServer RemoteDataArchiveLinkedServer

Gets or sets the remote data archive linked server for the database.

RemoteDataArchiveUseFederatedServiceAccount RemoteDataArchiveUseFederatedServiceAccount RemoteDataArchiveUseFederatedServiceAccount

Gets or sets a value whether the RemoteDataArchive uses the FederatedServiceAccount.

RemoteDatabaseName RemoteDatabaseName RemoteDatabaseName

Gets or sets the remote database name.

ReplicationOptions ReplicationOptions ReplicationOptions

Gets the active replication settings for a database.

Roles Roles Roles

Gets a collection of DatabaseRole objects. Each DatabaseRole object represents a role defined on the database.

Rules Rules Rules

Gets a collection of Rule objects. Each Rule object represents a rule defined on the database.

ScalarResult ScalarResult ScalarResult

Gets the scalar result for the referenced object.

(Inherited from SqlSmoObject)
Schemas Schemas Schemas

Gets a collection of Schema objects. Each Schema object represents a schema defined on the database.

SearchPropertyLists SearchPropertyLists SearchPropertyLists

Gets the SearchPropertyListCollection associated with this object.

SecurityPolicies SecurityPolicies SecurityPolicies

Gets the Security Policies from the Database.

Sequences Sequences Sequences

Gets the SequenceCollection associated with this object.

ServiceBroker ServiceBroker ServiceBroker

Gets the ServiceBroker object that represents the Service Broker.

ServiceBrokerGuid ServiceBrokerGuid ServiceBrokerGuid

Gets the Guid object that uniquely identifies the instance of Service Broker.

Size Size Size

Gets the size of the database in MB.

SnapshotIsolationState SnapshotIsolationState SnapshotIsolationState

Gets the snapshot isolation state for the database.

SpaceAvailable SpaceAvailable SpaceAvailable

Gets the available space in the database in KB.

State State State

Gets the state of the referenced object.

(Inherited from SmoObjectBase)
Status Status Status

Gets the database status.

StoredProcedures StoredProcedures StoredProcedures

Gets a collection of StoredProcedure objects. Each StoredProcedure object represents a stored procedure defined on the database.

SymmetricKeys SymmetricKeys SymmetricKeys

Gets a collection of SymmetricKey objects. Each SymmetricKey object represents a symmetric key defined on the database.

Synonyms Synonyms Synonyms

Gets a collection of Synonym objects. Each Synonym object represents a synonym defined on the database.

Tables Tables Tables

Gets a collection of Table objects. Each Table object represents a table defined on the database.

TargetRecoveryTime TargetRecoveryTime TargetRecoveryTime

Gets or sets the target recovery time of the used database.

TransformNoiseWords TransformNoiseWords TransformNoiseWords

Gets a value that indicates whether an object that sets the transform noise words configuration option is used.

Triggers Triggers Triggers

Gets a collection of DatabaseDdlTrigger objects. Each DatabaseDdlTrigger object represents a trigger defined on the database.

Trustworthy Trustworthy Trustworthy

Gets or sets a value that indicates whether the instance of SQL Server 2005 trusts the database and the contents within it.

TwoDigitYearCutoff TwoDigitYearCutoff TwoDigitYearCutoff

Gets or sets the specified object that is used to set the two digit year cutoff configuration option.

Urn Urn Urn

Gets the Uniform Resource Name (URN) address value that uniquely identifies the object.

(Inherited from SqlSmoObject)
UserAccess UserAccess UserAccess

Gets or sets the database user access.

UserData UserData UserData

Gets or sets user-defined data associated with the referenced object.

(Inherited from SmoObjectBase)
UserDefinedAggregates UserDefinedAggregates UserDefinedAggregates

Gets a collection of UserDefinedAggregate objects. Each UserDefinedAggregate object represents a user-defined aggregate defined on the database.

UserDefinedDataTypes UserDefinedDataTypes UserDefinedDataTypes

Gets a collection of UserDefinedDataType objects. Each UserDefinedDataType object represents a user-defined data type on the database.

UserDefinedFunctions UserDefinedFunctions UserDefinedFunctions

Gets a collection of UserDefinedFunction objects. Each UserDefinedFunction object represents a user-defined function on the database.

UserDefinedTableTypes UserDefinedTableTypes UserDefinedTableTypes

Gets a collection of UserDefinedTableType objects. Each UserDefinedTableType object represents a user-defined table type on the database.

UserDefinedTypes UserDefinedTypes UserDefinedTypes

Gets a collection of UserDefinedType objects. Each UserDefinedType object represents a user-defined type on the database.

UserName UserName UserName

Gets the database user name.

Users Users Users

Gets a collection of User objects. Each User object represents a user who is defined on the database.

Version Version Version

Gets the version of the instance of SQL Server that was used to create the database.

Views Views Views

Gets a collection of View objects. Each View object represents a view defined on the database.

XmlSchemaCollections XmlSchemaCollections XmlSchemaCollections

Gets a collection of XmlSchemaCollection objects. Each XmlSchemaCollection object represents an XML schema defined on the database.

Methods

AddDatabaseContext(StringCollection) AddDatabaseContext(StringCollection) AddDatabaseContext(StringCollection)

Add the database context to the collection of queries identified by the queries parameter.

(Inherited from SqlSmoObject)
Alter() Alter() Alter()

Updates any Database object property changes on the instance of SQL Server.

Alter(TerminationClause) Alter(TerminationClause) Alter(TerminationClause)

Updates any Database object property changes on the instance of SQL Server.

Alter(TimeSpan) Alter(TimeSpan) Alter(TimeSpan)

Updates any Database object property changes on the instance of SQL Server.

AlterImpl() AlterImpl() AlterImpl()

Activates the object altered event.

(Inherited from SqlSmoObject)
AlterImplWorker() AlterImplWorker() AlterImplWorker()

Calls the Alter methods.

(Inherited from SqlSmoObject)
AppendCommaText(StringBuilder, String, Boolean, String) AppendCommaText(StringBuilder, String, Boolean, String) AppendCommaText(StringBuilder, String, Boolean, String)

Appends text, optionally separated by a comma.

(Inherited from ScriptNameObjectBase)
AppendWithCommaText(StringBuilder, String, Boolean) AppendWithCommaText(StringBuilder, String, Boolean) AppendWithCommaText(StringBuilder, String, Boolean)

Appends text, optionally separated by a comma.

(Inherited from ScriptNameObjectBase)
AppendWithOption(StringBuilder, String, String, Boolean) AppendWithOption(StringBuilder, String, String, Boolean) AppendWithOption(StringBuilder, String, String, Boolean)

Appends text and option text separated from the main text with a “WITH” string and optionally separated by a comma.

(Inherited from ScriptNameObjectBase)
AutoGenerateName() AutoGenerateName() AutoGenerateName()

Generates a name automatically based on the object Guid.

(Inherited from ScriptNameObjectBase)
BindDefaultImpl(String, String, Boolean) BindDefaultImpl(String, String, Boolean) BindDefaultImpl(String, String, Boolean)

Binds the default items identified by the parameters.

(Inherited from SqlSmoObject)
BindRuleImpl(String, String, Boolean) BindRuleImpl(String, String, Boolean) BindRuleImpl(String, String, Boolean)

Binds the rule schema to the rule and columns identified by the parameters.

(Inherited from SqlSmoObject)
ChangeMirroringState(MirroringOption) ChangeMirroringState(MirroringOption) ChangeMirroringState(MirroringOption)

Changes the mirroring configuration as specified by the options.

CheckAllocations(RepairType) CheckAllocations(RepairType) CheckAllocations(RepairType)

Scans all pages of the referenced database and tests pages to help ensure integrity.

CheckAllocationsDataOnly() CheckAllocationsDataOnly() CheckAllocationsDataOnly()

Scans all pages of the referenced database and tests only the data to help ensure integrity.

CheckCatalog() CheckCatalog() CheckCatalog()

Tests the integrity of the database catalog.

CheckIdentityValues() CheckIdentityValues() CheckIdentityValues()

Verifies the integrity of all identity columns in tables in the database.

CheckObjectDirty() CheckObjectDirty() CheckObjectDirty()

Checks whether object has been modified and not persisted.

(Inherited from ScriptNameObjectBase)
CheckObjectState() CheckObjectState() CheckObjectState()

Validates the state of the referenced object.

(Inherited from SqlSmoObject)
CheckObjectState(Boolean) CheckObjectState(Boolean) CheckObjectState(Boolean)

Validates the state of the referenced object with the option to specify that an exception is thrown if the object is not yet created.

(Inherited from SqlSmoObject)
CheckObjectStateImpl(Boolean) CheckObjectStateImpl(Boolean) CheckObjectStateImpl(Boolean)

Checks the state of a SqlSmoObject.

(Inherited from SqlSmoObject)
Checkpoint() Checkpoint() Checkpoint()

Issues a checkpoint.

CheckTables(RepairType) CheckTables(RepairType) CheckTables(RepairType)

Tests the integrity of database pages for all tables and indexes defined on the tables of the database.

CheckTables(RepairType, RepairOptions) CheckTables(RepairType, RepairOptions) CheckTables(RepairType, RepairOptions)

Tests the integrity of database pages for all tables and indexes defined on the tables of the database.

CheckTables(RepairType, RepairOptions, RepairStructure, Nullable<Int64>) CheckTables(RepairType, RepairOptions, RepairStructure, Nullable<Int64>) CheckTables(RepairType, RepairOptions, RepairStructure, Nullable<Int64>)

Checks the tables in the collection with the specified repair type, options and structure.

CheckTables(RepairType, RepairStructure) CheckTables(RepairType, RepairStructure) CheckTables(RepairType, RepairStructure)

Tests the integrity of database pages for all tables and indexes defined on the tables of the database.

CheckTablesDataOnly() CheckTablesDataOnly() CheckTablesDataOnly()

Tests integrity of data in pages that store data for all tables and indexes defined on the tables of the referenced database.

CheckTablesDataOnly(RepairOptions) CheckTablesDataOnly(RepairOptions) CheckTablesDataOnly(RepairOptions)

Tests integrity of data in pages that store data for all tables and indexes defined on the tables of the referenced database, with the specified repair options.

CheckTablesDataOnly(RepairOptions, RepairStructure, Nullable<Int64>) CheckTablesDataOnly(RepairOptions, RepairStructure, Nullable<Int64>) CheckTablesDataOnly(RepairOptions, RepairStructure, Nullable<Int64>)

Tests integrity of data in pages that store data for all tables and indexes defined on the tables of the referenced database with the specified repair options, repair structure and nullable Int64 value.

CheckTablesDataOnly(RepairStructure) CheckTablesDataOnly(RepairStructure) CheckTablesDataOnly(RepairStructure)

Tests integrity of data in pages that store data for all tables and indexes defined on the tables of the referenced database with the specified repair structure.

CheckTextCorectness(String, Boolean, Boolean, String[], DdlTextParserHeaderInfo) CheckTextCorectness(String, Boolean, Boolean, String[], DdlTextParserHeaderInfo) CheckTextCorectness(String, Boolean, Boolean, String[], DdlTextParserHeaderInfo)

Checks text for correctness against the parameters.

(Inherited from ScriptNameObjectBase)
CheckTextModeSupport() CheckTextModeSupport() CheckTextModeSupport()

Checks mode of support.

(Inherited from ScriptNameObjectBase)
CleanObject() CleanObject() CleanObject()

Cleans the referenced object.

(Inherited from ScriptNameObjectBase)
Create() Create() Create()

Creates a database on the instance of SQL Server as defined by the Database object.

Create(Boolean) Create(Boolean) Create(Boolean)

Creates a database on the instance of SQL Server as defined by the Database object.

CreateImpl() CreateImpl() CreateImpl()

Creates an object with scripting options.

(Inherited from SqlSmoObject)
Deny(DatabasePermissionSet, String) Deny(DatabasePermissionSet, String) Deny(DatabasePermissionSet, String)

Denies the specified set of permissions for the specified grantee on the database.

Deny(DatabasePermissionSet, String, Boolean) Deny(DatabasePermissionSet, String, Boolean) Deny(DatabasePermissionSet, String, Boolean)

Denies the specified set of permissions for the specified grantee and other users who the grantee granted the specified set of permissions on the database.

Deny(DatabasePermissionSet, String[]) Deny(DatabasePermissionSet, String[]) Deny(DatabasePermissionSet, String[])

Denies the specified set of permissions for the specified grantees on the database.

Deny(DatabasePermissionSet, String[], Boolean) Deny(DatabasePermissionSet, String[], Boolean) Deny(DatabasePermissionSet, String[], Boolean)

Denies the specified set of permissions for the specified grantees and other users who the grantee granted the specified set of permissions on the database.

DisableAllPlanGuides() DisableAllPlanGuides() DisableAllPlanGuides()

Disables all Plan Guides in a database.

Discover() Discover() Discover()

Discovers a list of type Object.

(Inherited from SqlSmoObject)
Drop() Drop() Drop()

Drops the database.

DropAllPlanGuides() DropAllPlanGuides() DropAllPlanGuides()

Drops all Plan Guides in a database.

DropBackupHistory() DropBackupHistory() DropBackupHistory()

Drops the backup history for the database.

DropIfExists() DropIfExists() DropIfExists()

Drops the Database object if exists in the server.

DropImpl(Boolean) DropImpl(Boolean) DropImpl(Boolean)

Drops a SqlSmoObject.

(Inherited from SqlSmoObject)
DropImplWorker(Urn, Boolean) DropImplWorker(Urn, Boolean) DropImplWorker(Urn, Boolean)

Drops the IMPL worker.

(Inherited from SqlSmoObject)
EnableAllPlanGuides() EnableAllPlanGuides() EnableAllPlanGuides()

Enables all Plan Guides in a database.

EnumBackupSetFiles() EnumBackupSetFiles() EnumBackupSetFiles()

Returns a DataTable listing files contained in a backup set.

EnumBackupSetFiles(Int32) EnumBackupSetFiles(Int32) EnumBackupSetFiles(Int32)

Returns a Data table that lists the files in a backup set.

EnumBackupSets() EnumBackupSets() EnumBackupSets()

Returns a DataTable listing the backup sets associated with a database.

EnumCandidateKeys() EnumCandidateKeys() EnumCandidateKeys()

Enumerates a list of all candidate primary keys in the database, which can be referenced by a foreign key.

EnumDatabasePermissions() EnumDatabasePermissions() EnumDatabasePermissions()

Enumerates a list of all permissions in the database.

EnumDatabasePermissions(DatabasePermissionSet) EnumDatabasePermissions(DatabasePermissionSet) EnumDatabasePermissions(DatabasePermissionSet)

Enumerates a list of permissions in the database for the specified permission set.

EnumDatabasePermissions(String) EnumDatabasePermissions(String) EnumDatabasePermissions(String)

Enumerates a list of permissions in the database for the specified user.

EnumDatabasePermissions(String, DatabasePermissionSet) EnumDatabasePermissions(String, DatabasePermissionSet) EnumDatabasePermissions(String, DatabasePermissionSet)

Enumerates a list of permissions in the database for the specified user and a specified permission set.

EnumLocks() EnumLocks() EnumLocks()

Enumerates a list of all current locks held on the database.

EnumLocks(Int32) EnumLocks(Int32) EnumLocks(Int32)

Enumerates a list of current locks held on the database for a specified system process ID.

EnumLoginMappings() EnumLoginMappings() EnumLoginMappings()

Enumerates a list of SQL Server logins for all the users in the database.

EnumMatchingSPs(String) EnumMatchingSPs(String) EnumMatchingSPs(String)

Enumerates a list of stored procedures that contain the specified string in the definition.

EnumMatchingSPs(String, Boolean) EnumMatchingSPs(String, Boolean) EnumMatchingSPs(String, Boolean)

Enumerates a list of stored procedures that contain the specified string in the definition.

EnumObjectPermissions() EnumObjectPermissions() EnumObjectPermissions()

Enumerates a list of permissions for objects in the database.

EnumObjectPermissions(ObjectPermissionSet) EnumObjectPermissions(ObjectPermissionSet) EnumObjectPermissions(ObjectPermissionSet)

Enumerates a list of permissions for objects in the database limited to the specified permission set.

EnumObjectPermissions(String) EnumObjectPermissions(String) EnumObjectPermissions(String)

Enumerates a list of permissions for objects in the database that belong to the specified user.

EnumObjectPermissions(String, ObjectPermissionSet) EnumObjectPermissions(String, ObjectPermissionSet) EnumObjectPermissions(String, ObjectPermissionSet)

Enumerates a list of permissions for objects in the database that belong to the specified user and limited to the specified permission set.

EnumObjects() EnumObjects() EnumObjects()

Enumerates a list of objects in the database.

EnumObjects(DatabaseObjectTypes) EnumObjects(DatabaseObjectTypes) EnumObjects(DatabaseObjectTypes)

Enumerates a list of objects in the database.

EnumObjects(DatabaseObjectTypes, SortOrder) EnumObjects(DatabaseObjectTypes, SortOrder) EnumObjects(DatabaseObjectTypes, SortOrder)

Enumerates a list of objects in the database.

EnumTransactions() EnumTransactions() EnumTransactions()

Enumerates a list of open transactions on the database.

EnumTransactions(TransactionTypes) EnumTransactions(TransactionTypes) EnumTransactions(TransactionTypes)

Enumerates a list of open transactions of a specified type on the database.

EnumWindowsGroups() EnumWindowsGroups() EnumWindowsGroups()

Enumerates a list of Windows groups.

EnumWindowsGroups(String) EnumWindowsGroups(String) EnumWindowsGroups(String)

Enumerates a list of Windows groups for a specified group.

ExecuteNonQuery(String) ExecuteNonQuery(String) ExecuteNonQuery(String)

Executes a statement in the context of the database where there are no results returned.

ExecuteNonQuery(String, ExecutionTypes) ExecuteNonQuery(String, ExecutionTypes) ExecuteNonQuery(String, ExecutionTypes)

Executes a batch in the context of the database where there are no results returned for the specified execution type only.

ExecuteNonQuery(StringCollection) ExecuteNonQuery(StringCollection) ExecuteNonQuery(StringCollection)

Executes a batch in the context of the database where there are no results returned.

ExecuteNonQuery(StringCollection, Boolean) ExecuteNonQuery(StringCollection, Boolean) ExecuteNonQuery(StringCollection, Boolean)

Executes a batch of statements that does not return a result set.

(Inherited from SqlSmoObject)
ExecuteNonQuery(StringCollection, ExecutionTypes) ExecuteNonQuery(StringCollection, ExecutionTypes) ExecuteNonQuery(StringCollection, ExecutionTypes)

Runs a collection of batches in the context of the database where there are no results returned for the specified execution type only.

ExecuteRenameQuery(String) ExecuteRenameQuery(String) ExecuteRenameQuery(String)

Executes the rename query for the object.

(Inherited from NamedSmoObject)
ExecuteWithResults(String) ExecuteWithResults(String) ExecuteWithResults(String)

Executes a collection of batches in the context of the database where there are results returned.

ExecuteWithResults(StringCollection) ExecuteWithResults(StringCollection) ExecuteWithResults(StringCollection)

Executes a batch in the context of the database where there are results returned.

ForceTextModeOnTextBody() ForceTextModeOnTextBody() ForceTextModeOnTextBody()

Enforces text mode on the text body.

(Inherited from ScriptNameObjectBase)
FormatSqlVariant(Object) FormatSqlVariant(Object) FormatSqlVariant(Object)

Formats an object as Microsoft.Data.Schema.Sql.DataGenerator.SqlVariant type.

(Inherited from SqlSmoObject)
GenerateAlterEvent() GenerateAlterEvent() GenerateAlterEvent()

Generates the alter event with the specified value.

(Inherited from SqlSmoObject)
GenerateAlterEvent(Urn, Object) GenerateAlterEvent(Urn, Object) GenerateAlterEvent(Urn, Object)

Generates alter event with the specified URN and inner object value.

(Inherited from SqlSmoObject)
GetBraketNameForText() GetBraketNameForText() GetBraketNameForText()

Gets the bracket name for the text.

(Inherited from ScriptNameObjectBase)
GetContextDB() GetContextDB() GetContextDB()

Gets the context database that is associated with this object.

(Inherited from SqlSmoObject)
GetDBName() GetDBName() GetDBName()

Gets the database name that is associated with the object.

(Inherited from SqlSmoObject)
GetFragOptionString(FragmentationOption) GetFragOptionString(FragmentationOption) GetFragOptionString(FragmentationOption)

Gets a FragmentationOption object as a string value.

(Inherited from SqlSmoObject)
GetIsSystemNamed() GetIsSystemNamed() GetIsSystemNamed()

Indicates a value that specifies whether the system is named.

(Inherited from ScriptNameObjectBase)
GetIsTextDirty() GetIsTextDirty() GetIsTextDirty()

Determines whether the text value is consistent with stored value.

(Inherited from ScriptNameObjectBase)
GetPropValue(String) GetPropValue(String) GetPropValue(String)

Gets a property value of the SqlSmoObject object.

(Inherited from SqlSmoObject)
GetPropValueOptional(String) GetPropValueOptional(String) GetPropValueOptional(String)

Gets a property value of the SqlSmoObject object.

(Inherited from SqlSmoObject)
GetPropValueOptionalAllowNull(String) GetPropValueOptionalAllowNull(String) GetPropValueOptionalAllowNull(String)

Gets a property value of the SqlSmoObject object.

(Inherited from SqlSmoObject)
GetRealValue(Property, Object) GetRealValue(Property, Object) GetRealValue(Property, Object)

Gets a property value of the SqlSmoObject object.

(Inherited from SqlSmoObject)
GetRemoteDataArchiveMigrationStatusReports(DateTime, Int32, String) GetRemoteDataArchiveMigrationStatusReports(DateTime, Int32, String) GetRemoteDataArchiveMigrationStatusReports(DateTime, Int32, String)

Retrieve a list of RemoteDataArchiveMigrationStatusReport.

GetRemoteDatabaseMigrationStatistics() GetRemoteDatabaseMigrationStatistics() GetRemoteDatabaseMigrationStatistics()

Gets the statistics of the remote database migration.

GetServerName() GetServerName() GetServerName()

Gets the name of the instance of SQL Server with which the object is associated.

(Inherited from SqlSmoObject)
GetServerObject() GetServerObject() GetServerObject()

Gets the server of the SqlSmoObject object.

(Inherited from SqlSmoObject)
GetSqlServerVersionName() GetSqlServerVersionName() GetSqlServerVersionName()

Gets the version name of the instance of SQL Server with which the object is associated.

(Inherited from SqlSmoObject)
GetTextBody() GetTextBody() GetTextBody()

Returns the text body.

(Inherited from ScriptNameObjectBase)
GetTextBody(Boolean) GetTextBody(Boolean) GetTextBody(Boolean)

Returns the text body.

(Inherited from ScriptNameObjectBase)
GetTextHeader(Boolean) GetTextHeader(Boolean) GetTextHeader(Boolean)

Returns the text header.

(Inherited from ScriptNameObjectBase)
GetTextMode() GetTextMode() GetTextMode()

Determines whether the script name is using text mode.

(Inherited from ScriptNameObjectBase)
GetTextProperty(String) GetTextProperty(String) GetTextProperty(String)

Gets the text of the object, if not available, throw appropriate exception based on the state of the object.

(Inherited from ScriptNameObjectBase)
GetTransactionCount() GetTransactionCount() GetTransactionCount()

Gets the number of open transactions on the database.

GetTransactionCount(TransactionTypes) GetTransactionCount(TransactionTypes) GetTransactionCount(TransactionTypes)

Gets the number of open transactions of a specified type on the database.

GetUrnRecursive(StringBuilder) GetUrnRecursive(StringBuilder) GetUrnRecursive(StringBuilder)

Assigns an Urn object of the SqlSmoObject object.

(Inherited from SqlSmoObject)
GetUrnRecursive(StringBuilder, UrnIdOption) GetUrnRecursive(StringBuilder, UrnIdOption) GetUrnRecursive(StringBuilder, UrnIdOption)

Assigns an Urn object of the SqlSmoObject object.

(Inherited from SqlSmoObject)
Grant(DatabasePermissionSet, String) Grant(DatabasePermissionSet, String) Grant(DatabasePermissionSet, String)

Grants the specified set of permissions to the specified grantee on the database.

Grant(DatabasePermissionSet, String, Boolean) Grant(DatabasePermissionSet, String, Boolean) Grant(DatabasePermissionSet, String, Boolean)

Grants access to the specified permission to the grantee and the ability to grant access to other users on the database.

Grant(DatabasePermissionSet, String, Boolean, String) Grant(DatabasePermissionSet, String, Boolean, String) Grant(DatabasePermissionSet, String, Boolean, String)

Grants the specified set of permissions to the grantee and the ability to grant the set of permissions to other users on the database under an assumed role.

Grant(DatabasePermissionSet, String[]) Grant(DatabasePermissionSet, String[]) Grant(DatabasePermissionSet, String[])

Grants the specified set of permissions to the specified grantees on the database.

Grant(DatabasePermissionSet, String[], Boolean) Grant(DatabasePermissionSet, String[], Boolean) Grant(DatabasePermissionSet, String[], Boolean)

Grants access to the specified permission to the grantees and the ability to grant access to other users on the database.

Grant(DatabasePermissionSet, String[], Boolean, String) Grant(DatabasePermissionSet, String[], Boolean, String) Grant(DatabasePermissionSet, String[], Boolean, String)

Grants the specified set of permissions to the grantees and the ability to grant the set of permissions to other users on the database under an assumed role.

ImplInitialize(String[], OrderBy[]) ImplInitialize(String[], OrderBy[]) ImplInitialize(String[], OrderBy[])

Initializes the fields of the SqlSmoObject object.

(Inherited from SqlSmoObject)
Initialize() Initialize() Initialize()

Initializes the object and forces the properties be loaded.

(Inherited from SqlSmoObject)
Initialize(Boolean) Initialize(Boolean) Initialize(Boolean)

Initializes the object and forces the properties be loaded.

(Inherited from SqlSmoObject)
IsMember(String) IsMember(String) IsMember(String)

Determines whether the specified group or role belongs to the database.

IsObjectDirty() IsObjectDirty() IsObjectDirty()

Determines whether the referenced object is consistent with the stored object.

(Inherited from ScriptNameObjectBase)
IsObjectInitialized() IsObjectInitialized() IsObjectInitialized()

Verifies whether the object has been initialized.

(Inherited from SqlSmoObject)
IsObjectInSpace() IsObjectInSpace() IsObjectInSpace()

Verifies whether the object is isolated or connected to the instance of SQL Server.

(Inherited from SqlSmoObject)
IsSupportedProperty(String) IsSupportedProperty(String) IsSupportedProperty(String)

Determines whether the specified property is supported in the target .NET Framework.

(Inherited from SqlSmoObject)
IsVersion80SP3() IsVersion80SP3() IsVersion80SP3()

Determines whether the version of SQL Server is SQL Server 2000 with SP3.

(Inherited from SqlSmoObject)
IsVersion90AndAbove() IsVersion90AndAbove() IsVersion90AndAbove()

Determines whether the version of SQL Server is SQL Server 2005 or later.

(Inherited from SqlSmoObject)
MarkDropped() MarkDropped() MarkDropped()

Sets the SqlSmoState to dropped.

(Inherited from SqlSmoObject)
MarkForDropImpl(Boolean) MarkForDropImpl(Boolean) MarkForDropImpl(Boolean)

Sets the SqlSmoState for drop operation.

(Inherited from SqlSmoObject)
PostAlter() PostAlter() PostAlter()

The method that is activated after the SqlSmoObject is altered.

(Inherited from SqlSmoObject)
PostCreate() PostCreate() PostCreate()

The method that is activated after the SqlSmoObject is created.

(Inherited from SqlSmoObject)
PostDrop() PostDrop() PostDrop()

The method that is activated after the SqlSmoObject is dropped.

(Inherited from SqlSmoObject)
PrefetchObjects() PrefetchObjects() PrefetchObjects()

Prefetches database objects.

PrefetchObjects(Type) PrefetchObjects(Type) PrefetchObjects(Type)

Prefetches database objects of a specified type.

PrefetchObjects(Type, ScriptingOptions) PrefetchObjects(Type, ScriptingOptions) PrefetchObjects(Type, ScriptingOptions)

Prefetches database objects of a specified type with scripting options.

ReauthorizeRemoteDataArchiveConnection(String) ReauthorizeRemoteDataArchiveConnection(String) ReauthorizeRemoteDataArchiveConnection(String)

Reuthorizes the remote data archive connection.

RecalculateSpaceUsage() RecalculateSpaceUsage() RecalculateSpaceUsage()

Recalculates space usage.

Refresh() Refresh() Refresh()

Updates the Database object.

RemoveFullTextCatalogs() RemoveFullTextCatalogs() RemoveFullTextCatalogs()

Removes full-text catalogs from the database.

Rename(String) Rename(String) Rename(String)

Renames the database.

RenameImpl(String) RenameImpl(String) RenameImpl(String)

This method supports the SMO infrastructure and is not intended to be used directly from your code.

(Inherited from NamedSmoObject)
RenameImplWorker(String) RenameImplWorker(String) RenameImplWorker(String)

Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.

(Inherited from NamedSmoObject)
Revoke(DatabasePermissionSet, String) Revoke(DatabasePermissionSet, String) Revoke(DatabasePermissionSet, String)

Revokes a previously granted set of permissions from a grantee on the database.

Revoke(DatabasePermissionSet, String, Boolean, Boolean) Revoke(DatabasePermissionSet, String, Boolean, Boolean) Revoke(DatabasePermissionSet, String, Boolean, Boolean)

Revokes previously granted permissions from a grantee on the database and any other users to whom the grantee has granted the specified set of permissions. The grantee is also given the ability to revoke the specified set of permissions from other users under an assumed role.

Revoke(DatabasePermissionSet, String, Boolean, Boolean, String) Revoke(DatabasePermissionSet, String, Boolean, Boolean, String) Revoke(DatabasePermissionSet, String, Boolean, Boolean, String)

Revokes previously granted permissions from a grantee on the database and any other users to whom the grantee has granted the specified set of permissions. The grantee is also given the ability to revoke the specified set of permissions from other users under an assumed role.

Revoke(DatabasePermissionSet, String[]) Revoke(DatabasePermissionSet, String[]) Revoke(DatabasePermissionSet, String[])

Revokes a previously granted set of permissions from a list of grantees on the database.

Revoke(DatabasePermissionSet, String[], Boolean, Boolean) Revoke(DatabasePermissionSet, String[], Boolean, Boolean) Revoke(DatabasePermissionSet, String[], Boolean, Boolean)

Revokes previously granted permissions from grantees on the database and any other users to whom the grantees have granted the specified set of permissions. The grantees are also given the ability to revoke the specified set of permissions from other users under an assumed role.

Revoke(DatabasePermissionSet, String[], Boolean, Boolean, String) Revoke(DatabasePermissionSet, String[], Boolean, Boolean, String) Revoke(DatabasePermissionSet, String[], Boolean, Boolean, String)

Revokes previously granted permissions from grantees on the database and any other users to whom the grantees have granted the specified set of permissions. The grantees are also given the ability to revoke the specified set of permissions from other users under an assumed role.

Script() Script() Script()

Generates a Transact-SQL script that can be used to re-create the database.

Script(ScriptingOptions) Script(ScriptingOptions) Script(ScriptingOptions)

Generates a Transact-SQL script that can be used to re-create the database as specified by the script options.

ScriptImpl() ScriptImpl() ScriptImpl()

Gets a collection of scripts of the SqlSmoObject.

(Inherited from SqlSmoObject)
ScriptImpl(ScriptingOptions) ScriptImpl(ScriptingOptions) ScriptImpl(ScriptingOptions)

Gets a collection of scripts of the SqlSmoObject.

(Inherited from SqlSmoObject)
SetCollectionTextMode(Boolean, SmoCollectionBase) SetCollectionTextMode(Boolean, SmoCollectionBase) SetCollectionTextMode(Boolean, SmoCollectionBase)

Sets the collection text mode.

(Inherited from ScriptNameObjectBase)
SetDefaultFileGroup(String) SetDefaultFileGroup(String) SetDefaultFileGroup(String)

Sets the default file group for the database.

SetDefaultFileStreamFileGroup(String) SetDefaultFileStreamFileGroup(String) SetDefaultFileStreamFileGroup(String)

Sets the default filestream group.

SetDefaultFullTextCatalog(String) SetDefaultFullTextCatalog(String) SetDefaultFullTextCatalog(String)

Sets the default full-text catalog for the database.

SetIsSystemNamed(Boolean) SetIsSystemNamed(Boolean) SetIsSystemNamed(Boolean)

Specifies a value that indicates whether the system is named.

(Inherited from ScriptNameObjectBase)
SetOffline() SetOffline() SetOffline()

Sets the database offline.

SetOnline() SetOnline() SetOnline()

Sets the database online.

SetOwner(String) SetOwner(String) SetOwner(String)

Sets the database owner.

SetOwner(String, Boolean) SetOwner(String, Boolean) SetOwner(String, Boolean)

Sets the database owner.

SetParentImpl(SqlSmoObject) SetParentImpl(SqlSmoObject) SetParentImpl(SqlSmoObject)

Sets the parent of the SqlSmoObject to the newParent parameter.

(Inherited from SqlSmoObject)
SetSchemaOwned() SetSchemaOwned() SetSchemaOwned()

Sets the schema owned value for the named Smo object.

(Inherited from NamedSmoObject)
SetSnapshotIsolation(Boolean) SetSnapshotIsolation(Boolean) SetSnapshotIsolation(Boolean)

Sets the snapshot isolation level.

SetTextBody(String) SetTextBody(String) SetTextBody(String)

Specifies the text body.

(Inherited from ScriptNameObjectBase)
SetTextHeader(String) SetTextHeader(String) SetTextHeader(String)

Specifies the text header.

(Inherited from ScriptNameObjectBase)
SetTextMode(Boolean, SmoCollectionBase[]) SetTextMode(Boolean, SmoCollectionBase[]) SetTextMode(Boolean, SmoCollectionBase[])

Specifies the text mode.

(Inherited from ScriptNameObjectBase)
Shrink(Int32, ShrinkMethod) Shrink(Int32, ShrinkMethod) Shrink(Int32, ShrinkMethod)

Shrinks the database.

SwitchTextMode(Boolean, SmoCollectionBase[]) SwitchTextMode(Boolean, SmoCollectionBase[]) SwitchTextMode(Boolean, SmoCollectionBase[])

Switches the text mode.

(Inherited from ScriptNameObjectBase)
ThrowIfAboveVersion100(String) ThrowIfAboveVersion100(String) ThrowIfAboveVersion100(String)

Throws the object if above version 100.

(Inherited from SqlSmoObject)
ThrowIfAboveVersion80(String) ThrowIfAboveVersion80(String) ThrowIfAboveVersion80(String)

Throws SqlSmoObject if version is above 80.

(Inherited from SqlSmoObject)
ThrowIfBelowVersion100(String) ThrowIfBelowVersion100(String) ThrowIfBelowVersion100(String)

Throws exception if the version is below 100.

(Inherited from SqlSmoObject)
ThrowIfBelowVersion110(String) ThrowIfBelowVersion110(String) ThrowIfBelowVersion110(String)

Throws the object if the version belows 110.

(Inherited from SqlSmoObject)
ThrowIfBelowVersion110Prop(String) ThrowIfBelowVersion110Prop(String) ThrowIfBelowVersion110Prop(String)

Throws the SqlSmoObject if version is below 110Prop.

(Inherited from SqlSmoObject)
ThrowIfBelowVersion120(String) ThrowIfBelowVersion120(String) ThrowIfBelowVersion120(String)

Throws the object if the version is below 120.

(Inherited from SqlSmoObject)
ThrowIfBelowVersion120Prop(String) ThrowIfBelowVersion120Prop(String) ThrowIfBelowVersion120Prop(String)

Throws the object if the version belows 120 property.

(Inherited from SqlSmoObject)
ThrowIfBelowVersion130(String) ThrowIfBelowVersion130(String) ThrowIfBelowVersion130(String)

Throws the object if the version is below 130.

(Inherited from SqlSmoObject)
ThrowIfBelowVersion130Prop(String) ThrowIfBelowVersion130Prop(String) ThrowIfBelowVersion130Prop(String)

Throws an object if BelowVersion130Prop.

(Inherited from SqlSmoObject)
ThrowIfBelowVersion80(String) ThrowIfBelowVersion80(String) ThrowIfBelowVersion80(String)

Throws the object if the version is below 80.

(Inherited from SqlSmoObject)
ThrowIfBelowVersion80SP3() ThrowIfBelowVersion80SP3() ThrowIfBelowVersion80SP3()

Throws an exception if the version is below 80SP3.

(Inherited from SqlSmoObject)
ThrowIfBelowVersion90(String) ThrowIfBelowVersion90(String) ThrowIfBelowVersion90(String)

Throws the object if the version is below 90.

(Inherited from SqlSmoObject)
ThrowIfTextIsDirtyForAlter() ThrowIfTextIsDirtyForAlter() ThrowIfTextIsDirtyForAlter()

Throws an exception of text has been modified and not persisted.

(Inherited from ScriptNameObjectBase)
ToString() ToString() ToString()

Returns a String that represents the referenced object.

(Inherited from SqlSmoObject)
TouchImpl() TouchImpl() TouchImpl()

Implements a touch object.

(Inherited from SqlSmoObject)
TruncateLog() TruncateLog() TruncateLog()

Truncates the database log.

UnbindDefaultImpl(Boolean) UnbindDefaultImpl(Boolean) UnbindDefaultImpl(Boolean)

Unbinds the default columns of the SqlSmoObject.

(Inherited from SqlSmoObject)
UnbindRuleImpl(Boolean) UnbindRuleImpl(Boolean) UnbindRuleImpl(Boolean)

Unbinds rules of the SqlSmoObject.

(Inherited from SqlSmoObject)
UpdateIndexStatistics() UpdateIndexStatistics() UpdateIndexStatistics()

Updates index statistics.

Validate(String, Object[]) Validate(String, Object[]) Validate(String, Object[])

Validates the state of an object.

(Inherited from SmoObjectBase)
ValidateAllPlanGuides() ValidateAllPlanGuides() ValidateAllPlanGuides()

Verifies the validity of the execution plans associated with the database.

ValidateAllPlanGuides(DataTable) ValidateAllPlanGuides(DataTable) ValidateAllPlanGuides(DataTable)

Verifies the validity of the execution plans associated with the database and returns validation report.

Explicit Interface Implementations

IAlienObject.Discover() IAlienObject.Discover() IAlienObject.Discover()

Discovers any dependencies.

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SqlSmoObject)
IAlienObject.GetDomainRoot() IAlienObject.GetDomainRoot() IAlienObject.GetDomainRoot()

Returns the root of the domain.

(Inherited from SqlSmoObject)
IAlienObject.GetParent() IAlienObject.GetParent() IAlienObject.GetParent()

Gets the parent of this object. Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SqlSmoObject)
IAlienObject.GetPropertyType(String) IAlienObject.GetPropertyType(String) IAlienObject.GetPropertyType(String)

Gets the type of the specified property.

(Inherited from SqlSmoObject)
IAlienObject.GetPropertyValue(String, Type) IAlienObject.GetPropertyValue(String, Type) IAlienObject.GetPropertyValue(String, Type)

Gets the value of the specified property.

(Inherited from SqlSmoObject)
IAlienObject.GetUrn() IAlienObject.GetUrn() IAlienObject.GetUrn()

Gets the Unified Resource Name (URN) of the object.

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SqlSmoObject)
IAlienObject.Resolve(String) IAlienObject.Resolve(String) IAlienObject.Resolve(String)

Gets the instance that contains the information about the object from the Unified Resource Name (URN) of the object.

(Inherited from SqlSmoObject)
IAlienObject.SetObjectState(SfcObjectState) IAlienObject.SetObjectState(SfcObjectState) IAlienObject.SetObjectState(SfcObjectState)

Sets the object state to the specified SfcObjectState value.

(Inherited from SqlSmoObject)
IAlienObject.SetPropertyValue(String, Type, Object) IAlienObject.SetPropertyValue(String, Type, Object) IAlienObject.SetPropertyValue(String, Type, Object)

Sets the property value.

(Inherited from SqlSmoObject)
ISfcPropertyProvider.GetPropertySet() ISfcPropertyProvider.GetPropertySet() ISfcPropertyProvider.GetPropertySet()

Gets the interface reference to the set of properties of this object.

Do not reference this member directly in your code. It supports the SQL Server infrastructure.

(Inherited from SqlSmoObject)
ISfcSupportsDesignMode.IsDesignMode ISfcSupportsDesignMode.IsDesignMode ISfcSupportsDesignMode.IsDesignMode

Gets a value that indicates whether the object supports design mode.

Fields

m_ExtendedProperties m_ExtendedProperties m_ExtendedProperties

Represents a property that is defined to extend the properties provided by a SqlSmoObject.

(Inherited from SqlSmoObject)
singletonParent singletonParent singletonParent

Represents the singleton parent.

(Inherited from SqlSmoObject)

Events

PropertyChanged PropertyChanged PropertyChanged

Represents the event that occurs when a property is changed.

(Inherited from SqlSmoObject)
PropertyMetadataChanged PropertyMetadataChanged PropertyMetadataChanged

Represents the event that occurs when property metadata changes.

(Inherited from SqlSmoObject)

Applies to