Database 클래스

Represents an SQL Server database.

상속 계층

System.Object
  Microsoft.SqlServer.Management.Smo.SmoObjectBase
    Microsoft.SqlServer.Management.Smo.SqlSmoObject
      Microsoft.SqlServer.Management.Smo.NamedSmoObject
        Microsoft.SqlServer.Management.Smo.ScriptNameObjectBase
          Microsoft.SqlServer.Management.Smo.Database

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
<PhysicalFacetAttribute> _
<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)> _
Public NotInheritable Class Database _
    Inherits ScriptNameObjectBase _
    Implements ICreatable, IAlterable, IDroppable, IRenamable,  _
    IExtendedProperties, IScriptable, IDatabaseOptions, IDmfFacet, ISfcSupportsDesignMode
‘사용 방법
Dim instance As Database
[PhysicalFacetAttribute]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)]
public sealed class Database : ScriptNameObjectBase, 
    ICreatable, IAlterable, IDroppable, IRenamable, IExtendedProperties, 
    IScriptable, IDatabaseOptions, IDmfFacet, ISfcSupportsDesignMode
[PhysicalFacetAttribute]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode::CheckOnSchedule)]
public ref class Database sealed : public ScriptNameObjectBase, 
    ICreatable, IAlterable, IDroppable, IRenamable, IExtendedProperties, 
    IScriptable, IDatabaseOptions, IDmfFacet, ISfcSupportsDesignMode
[<SealedAttribute>]
[<PhysicalFacetAttribute>]
[<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)>]
type Database =  
    class 
        inherit ScriptNameObjectBase 
        interface ICreatable 
        interface IAlterable 
        interface IDroppable 
        interface IRenamable 
        interface IExtendedProperties 
        interface IScriptable 
        interface IDatabaseOptions 
        interface IDmfFacet 
        interface ISfcSupportsDesignMode 
    end
public final class Database extends ScriptNameObjectBase implements ICreatable, IAlterable, IDroppable, IRenamable, IExtendedProperties, IScriptable, IDatabaseOptions, IDmfFacet, ISfcSupportsDesignMode

Database 유형에서 다음 멤버를 표시합니다.

생성자

  이름 설명
공용 메서드 Database() Initializes a new instance of the Database class.
공용 메서드 Database(Server, String) Initializes a new instance of the Database class on the specified server and with the specified name.

맨 위로 이동

속성

  이름 설명
공용 속성 ActiveConnections Gets the number of active connections to the database.
공용 속성 ActiveDirectory 더 이상 사용되지 않습니다. Gets the information about the Active Directory settings for the database.
공용 속성 AnsiNullDefault Gets or sets a value that specifies whether the ANSI_NULL_DEFAULT database option is active.
공용 속성 AnsiNullsEnabled Gets or sets a value that specifies whether the ANSI_NULLS_ENABLED database option is active.
공용 속성 AnsiPaddingEnabled Gets or sets a value that specifies whether the ANSI_PADDING_ENABLED database option is active.
공용 속성 AnsiWarningsEnabled Gets or sets a value that specifies whether the ANSI_WARNINGS_ENABLED database option is active.
공용 속성 ApplicationRoles Gets a collection of ApplicationRole objects. Each ApplicationRole object represents an application role defined on the database.
공용 속성 ArithmeticAbortEnabled Gets or sets a value that specifies whether the ARITHMETICABORT database option is active.
공용 속성 Assemblies Gets a collection of SqlAssembly objects. Each SqlAssembly object represents an assembly defined on the database.
공용 속성 AsymmetricKeys Gets a collection of AsymmetricKey objects. Each AsymmetricKey object represents an asymmetric key defined on the database.
공용 속성 AutoClose Gets or sets a value that specifies whether the AUTOCLOSE database option is set.
공용 속성 AutoCreateStatisticsEnabled Gets a value that specifies whether statistics are automatically created for the database.
공용 속성 AutoShrink Gets or sets a value that specifies whether the AUTO_SHRINK database option is active.
공용 속성 AutoUpdateStatisticsAsync Gets or sets a value that specifies whether the AUTOUPDATESTATISTICSASYNC database option is active.
공용 속성 AutoUpdateStatisticsEnabled Gets or sets a value that specifies whether statistics are automatically updated for the database.
공용 속성 AvailabilityDatabaseSynchronizationState Gets the synchronization state of the availability database.
공용 속성 AvailabilityGroupName Gets the availability group name in the database.
공용 속성 BrokerEnabled Gets or sets a value that specifies whether the Service Broker service is enabled.
공용 속성 CaseSensitive Gets a value that specifies whether uppercase letters and lowercase letters are evaluated as equal.
공용 속성 Certificates Gets a collection of Certificate objects. Each Certificate object represents a certificate defined on the database.
공용 속성 ChangeTrackingAutoCleanUp Gets or sets a value that specifies whether the CHANGE_TRACKING_AUTO_CLEANUP OPTION is enabled.
공용 속성 ChangeTrackingEnabled Gets or sets a value that specifies whether the CHANGE_TRACKING_VALUE option is enabled
공용 속성 ChangeTrackingRetentionPeriod Gets or sets the CHANGE_TRACKING_RETENTION_PERIOD value.
공용 속성 ChangeTrackingRetentionPeriodUnits Gets or sets the unit type for a retention period value.
공용 속성 CloseCursorsOnCommitEnabled Gets or sets a value that specifies whether the CURSOR_CLOSE_ON_COMMIT database option is active.
공용 속성 Collation Gets or sets the default collation used by the database.
공용 속성 CompatibilityLevel Gets or sets the compatibility level for the database.
공용 속성 ConcatenateNullYieldsNull Gets or sets a value that specifies whether the CONCAT_NULL_YIELDS_NULL database option is active.
공용 속성 ContainmentType Gets or sets the type of containment.
공용 속성 CreateDate Gets the date that the database was created.
공용 속성 DatabaseAuditSpecifications Gets a collection of DatabaseAuditSpecification objects. Each DatabaseAuditSpecification object represents a database audit specification defined on the server.
공용 속성 DatabaseEncryptionKey Gets a DataBaseEncryptionKey data type.
공용 속성 DatabaseGuid Gets the Guid value that uniquely identifies the database.
공용 속성 DatabaseOptions Gets the DatabaseOptions object that contains configuration options for the database.
공용 속성 DatabaseOwnershipChaining Gets or sets a value that specifies whether the database ownership chaining is active.
공용 속성 DatabaseSnapshotBaseName Gets the name of the snapshot base for the database.
공용 속성 DataSpaceUsage Gets the space used by the data in the database.
공용 속성 DateCorrelationOptimization Gets or sets a value that specifies whether the date correlation optimization is active.
공용 속성 DboLogin Gets a value that specifies whether the current user is logged on as the database owner (DBO).
공용 속성 DefaultFileGroup Gets the default file group used by the database.
공용 속성 DefaultFileStreamFileGroup Gets the file group name for the default file stream.
공용 속성 DefaultFullTextCatalog Gets the default full-text catalog used by the database.
공용 속성 DefaultFullTextLanguage Gets the default full text language.
공용 속성 DefaultLanguage Gets or sets the default language.
공용 속성 Defaults Gets a collection of Default objects. Each Default object represents a default defined on the database.
공용 속성 DefaultSchema Gets the default schema of the user.
공용 속성 EncryptionEnabled Gets or sets a value that indicates whether the data encryption is enabled.
공용 속성 Events Gets the events associated with the database.
공용 속성 ExtendedProperties Gets the extended properties of the database.
공용 속성 ExtendedStoredProcedures Gets a collection of ExtendedStoredProcedure objects. Each ExtendedStoredProcedure object represents an extended stored procedure defined on the database.
공용 속성 Federations Gets a collection of Federation objects. Each Federation represents a data being partitioned on the database.
공용 속성 FileGroups Gets a collection of FileGroup objects. Each FileGroup object represents a file group defined on the database.
공용 속성 FilestreamDirectoryName Gets or sets the name of file stream share directory.
공용 속성 FilestreamNonTransactedAccess Gets or sets the file stream non-transacted access setting for database.
공용 속성 FullTextCatalogs Gets a collection of FullTextCatalog objects. Each FullTextCatalog object represents a full-text catalog defined on the database.
공용 속성 FullTextStopLists Gets a collection of FullTextStopList objects. Each FullTextStopList object represents a full text stop list defined on the server.
공용 속성 HonorBrokerPriority Gets or sets a value that specifies whether the priority specified by the broker is acknowledged or not.
공용 속성 ID Gets the database ID value that uniquely identifies the database.
공용 속성 IndexSpaceUsage Gets the space used by the indexes in the database.
공용 속성 IsAccessible Gets a value that specifies whether the database can be accessed.
공용 속성 IsDatabaseSnapshot Gets a value that specifies whether the database is a snapshot database.
공용 속성 IsDatabaseSnapshotBase Gets a value that specifies whether the database is the base database for a snapshot database.
공용 속성 IsDbAccessAdmin Gets a value that specifies whether the current user is a member of the DbAccessAdmin database role.
공용 속성 IsDbBackupOperator Gets a value that specifies whether the current user is a member of the DbBackupOperator database role.
공용 속성 IsDbDatareader Gets a value that specifies whether the current user is a member of the DbDatareader database role.
공용 속성 IsDbDatawriter Gets a value that specifies whether the current user is a member of the DbDatawriter database role.
공용 속성 IsDbDdlAdmin Gets a value that specifies whether the current user is a member of the DbDdlAdmin database role.
공용 속성 IsDbDenyDatareader Gets a value that specifies whether the current user is a member of the DbDenyDatareader database role.
공용 속성 IsDbDenyDatawriter Gets a value that specifies whether the current member is a member of the DbDenyDatawriter database.
공용 속성 IsDbManager Gets a value that specifies whether the current login is a database manager in SQL 데이터베이스.
공용 속성 IsDbOwner Gets a value that specifies whether the current user is a member of the DbOwner database role.
공용 속성 IsDbSecurityAdmin Gets a value that specifies whether the current user is a member of the DbSecurityAdmin database role.
공용 속성 IsFederationMember Gets or sets a value that specifies whether the database is a member of federation.
공용 속성 IsFullTextEnabled Gets or sets a value that specifies whether the database is enabled for full-text search.
공용 속성 IsLoginManager Gets a value that specifies whether the current login is a login manager in SQL 데이터베이스.
공용 속성 IsMailHost Gets a value that specifies whether the database is configured as a mail host.
공용 속성 IsManagementDataWarehouse Gets a value that specifies whether the database is a management data warehouse.
공용 속성 IsMirroringEnabled Gets a value that specifies whether mirroring is enabled on the database.
공용 속성 IsParameterizationForced Gets or sets a value that specifies whether parameterization is forced on the database.
공용 속성 IsReadCommittedSnapshotOn Gets or sets a value that specifies whether transactions with the read committed isolation level use row versioning.
공용 속성 IsSystemObject Gets a value that specifies whether the database is a system object or a user-defined database.
공용 속성 IsUpdateable Gets a value that specifies whether the database can be updated.
공용 속성 IsVarDecimalStorageFormatEnabled Gets or sets a value that specifies whether VarDecimal storage is enabled.
공용 속성 LastBackupDate Gets the date and time when the database was last backed up.
공용 속성 LastDifferentialBackupDate Gets the date and time when the last differential backup was performed.
공용 속성 LastLogBackupDate Gets the date and time when the transaction log was last backed up.
공용 속성 LocalCursorsDefault Gets or sets a value that specifies whether the local server cursors are used by default.
공용 속성 LogFiles Gets a collection of LogFile objects. Each LogFile object represents a log file defined on the database.
공용 속성 LogReuseWaitStatus Gets the type of operation on which the reuse of transaction log space is waiting.
공용 속성 MasterKey Gets the master key that is used to encrypt the private keys of certificates.
공용 속성 MirroringFailoverLogSequenceNumber Gets the log sequence number at last failover.
공용 속성 MirroringID Gets the ID value that uniquely identifies the mirroring partnership.
공용 속성 MirroringPartner Gets or sets the address of the 데이터베이스 엔진 instance that is the partner server for database mirroring.
공용 속성 MirroringPartnerInstance Gets the instance of SQL Server on which the mirroring partner is configured.
공용 속성 MirroringRedoQueueMaxSize Gets the maximum size of the redo queue of the mirror server instance in KB.
공용 속성 MirroringRoleSequence Gets the role sequence number for primary/backup roles played by the mirroring partners.
공용 속성 MirroringSafetyLevel Gets or sets the mirroring safety level.
공용 속성 MirroringSafetySequence Gets the role sequence number for safety levels for the mirroring partners.
공용 속성 MirroringStatus Gets the status of the database and the database mirroring session.
공용 속성 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 Gets or sets the name of the 데이터베이스 엔진 instance of the database mirroring witness server.
공용 속성 MirroringWitnessStatus Gets the status of the mirroring witness server.
공용 속성 Name Gets or sets the name of the database. (NamedSmoObject.Name을(를) 재정의함)
공용 속성 NestedTriggersEnabled Gets or sets a value that indicates whether the nested triggers are enabled.
공용 속성 NumericRoundAbortEnabled Gets or sets a value that specifies whether the NUMERIC_ROUNDABORT database option is active.
공용 속성 Owner Gets the database principal that is the owner of the database.
공용 속성 PageVerify Gets or sets the type of page integrity check that SQL Server performs when reading database pages.
공용 속성 Parent Gets or sets the Server object that is the parent of the Database object.
공용 속성 PartitionFunctions Gets a collection of PartitionFunction objects. Each PartitionFunction object represents a partition function defined on the database.
공용 속성 PartitionSchemes Gets a collection of PartitionScheme objects. Each PartitionScheme object represents a partition scheme defined on the database.
공용 속성 PlanGuides Gets a collection of plan guides associated with a database.
공용 속성 PrimaryFilePath Gets the operating system directory that contains the primary file for the database.
공용 속성 Properties Gets a collection of Property objects that represent the object properties. (SqlSmoObject에서 상속됨)
공용 속성 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 Gets or sets a value that specifies whether the database is read-only.
공용 속성 RecoveryForkGuid Gets the GUID value that specifies the recovery fork on which the database is currently active.
공용 속성 RecoveryModel Gets or sets the recovery model for the database.
공용 속성 RecursiveTriggersEnabled Gets or sets a value that specifies whether recursive triggers are enabled on the database.
공용 속성 ReplicationOptions Gets the active replication settings for a database.
공용 속성 Roles Gets a collection of DatabaseRole objects. Each DatabaseRole object represents a role defined on the database.
공용 속성 Rules Gets a collection of Rule objects. Each Rule object represents a rule defined on the database.
공용 속성 Schemas Gets a collection of Schema objects. Each Schema object represents a schema defined on the database.
공용 속성 SearchPropertyLists Gets the SearchPropertyListCollection associated with this object.
공용 속성 Sequences Gets the SequenceCollection associated with this object.
공용 속성 ServiceBroker Gets the ServiceBroker object that represents the Service Broker.
공용 속성 ServiceBrokerGuid Gets the Guid object that uniquely identifies the instance of Service Broker.
공용 속성 Size Gets the size of the database in MB.
공용 속성 SnapshotIsolationState Gets the snapshot isolation state for the database.
공용 속성 SpaceAvailable Gets the available space in the database in KB.
공용 속성 State Gets the state of the referenced object. (SmoObjectBase에서 상속됨)
공용 속성 Status Gets the database status.
공용 속성 StoredProcedures Gets a collection of StoredProcedure objects. Each StoredProcedure object represents a stored procedure defined on the database.
공용 속성 SymmetricKeys Gets a collection of SymmetricKey objects. Each SymmetricKey object represents a symmetric key defined on the database.
공용 속성 Synonyms Gets a collection of Synonym objects. Each Synonym object represents a synonym defined on the database.
공용 속성 Tables Gets a collection of Table objects. Each Table object represents a table defined on the database.
공용 속성 TargetRecoveryTime Gets or sets the target recovery time of the used database.
공용 속성 TransformNoiseWords Gets a value that indicates whether an object that sets the transform noise words configuration option is used.
공용 속성 Triggers Gets a collection of DatabaseDdlTrigger objects. Each DatabaseDdlTrigger object represents a trigger defined on the database.
공용 속성 Trustworthy Gets or sets a value that indicates whether the instance of SQL Server 2005 trusts the database and the contents within it.
공용 속성 TwoDigitYearCutoff Gets or sets the specified object that is used to set the two digit year cutoff configuration option.
공용 속성 Urn Gets the Uniform Resource Name (URN) address value that uniquely identifies the object. (SqlSmoObject에서 상속됨)
공용 속성 UserAccess Gets or sets the database user access.
공용 속성 UserData Gets or sets user-defined data associated with the referenced object. (SmoObjectBase에서 상속됨)
공용 속성 UserDefinedAggregates Gets a collection of UserDefinedAggregate objects. Each UserDefinedAggregate object represents a user-defined aggregate defined on the database.
공용 속성 UserDefinedDataTypes Gets a collection of UserDefinedDataType objects. Each UserDefinedDataType object represents a user-defined data type on the database.
공용 속성 UserDefinedFunctions Gets a collection of UserDefinedFunction objects. Each UserDefinedFunction object represents a user-defined function on the database.
공용 속성 UserDefinedTableTypes Gets a collection of UserDefinedTableType objects. Each UserDefinedTableType object represents a user-defined table type on the database.
공용 속성 UserDefinedTypes Gets a collection of UserDefinedType objects. Each UserDefinedType object represents a user-defined type on the database.
공용 속성 UserName Gets the database user name.
공용 속성 Users Gets a collection of User objects. Each User object represents a user who is defined on the database.
공용 속성 Version Gets the version of the instance of SQL Server that was used to create the database.
공용 속성 Views Gets a collection of View objects. Each View object represents a view defined on the database.
공용 속성 XmlSchemaCollections Gets a collection of XmlSchemaCollection objects. Each XmlSchemaCollection object represents an XML schema defined on the database.

맨 위로 이동

메서드

  이름 설명
공용 메서드 Alter() Updates any Database object property changes on the instance of SQL Server. 
공용 메서드 Alter(TimeSpan) Updates any Database object property changes on the instance of SQL Server. 
공용 메서드 Alter(TerminationClause) Updates any Database object property changes on the instance of SQL Server. 
공용 메서드 ChangeMirroringState Changes the mirroring configuration as specified by the options.
공용 메서드 CheckAllocations Scans all pages of the referenced database and tests pages to help ensure integrity.
공용 메서드 CheckAllocationsDataOnly Scans all pages of the referenced database and tests only the data to help ensure integrity.
공용 메서드 CheckCatalog Tests the integrity of the database catalog.
공용 메서드 CheckIdentityValues Verifies the integrity of all identity columns in tables in the database.
공용 메서드 Checkpoint Issues a checkpoint.
공용 메서드 CheckTables(RepairType) Tests the integrity of database pages for all tables and indexes defined on the tables of the database.
공용 메서드 CheckTables(RepairType, RepairOptions) Tests the integrity of database pages for all tables and indexes defined on the tables of the database.
공용 메서드 CheckTables(RepairType, RepairStructure) Tests the integrity of database pages for all tables and indexes defined on the tables of the database.
공용 메서드 CheckTables(RepairType, RepairOptions, RepairStructure) Tests the integrity of database pages for all tables and indexes defined on the tables of the database.
공용 메서드 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) 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(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.
공용 메서드 CheckTablesDataOnly(RepairOptions, 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 options and repair structure.
공용 메서드 Create() Creates a database on the instance of SQL Server as defined by the Database object.
공용 메서드 Create(Boolean) Creates a database on the instance of SQL Server as defined by the Database object.
공용 메서드 Deny(DatabasePermissionSet, String) Denies the specified set of permissions for the specified grantee on the database.
공용 메서드 Deny(DatabasePermissionSet, array<String[]) Denies the specified set of permissions for the specified grantees on the database.
공용 메서드 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, array<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 Disables all Plan Guides in a database.
공용 메서드 Discover Discovers a list of type Object. (SqlSmoObject에서 상속됨)
공용 메서드 Drop Drops the database.
공용 메서드 DropAllPlanGuides Drops all Plan Guides in a database.
공용 메서드 DropBackupHistory Drops the backup history for the database.
공용 메서드 EnableAllPlanGuides Enables all Plan Guides in a database.
공용 메서드 EnumBackupSetFiles() Returns a DataTable listing files contained in a backup set.
공용 메서드 EnumBackupSetFiles(Int32) Returns a Data table that lists the files in a backup set
공용 메서드 EnumBackupSets Returns a DataTable listing the backup sets associated with a database.
공용 메서드 EnumCandidateKeys Enumerates a list of all candidate primary keys in the database, which can be referenced by a foreign key.
공용 메서드 EnumDatabasePermissions() Enumerates a list of all permissions in the database.
공용 메서드 EnumDatabasePermissions(String) Enumerates a list of permissions in the database for the specified user.
공용 메서드 EnumDatabasePermissions(DatabasePermissionSet) Enumerates a list of permissions in the database for the specified permission set.
공용 메서드 EnumDatabasePermissions(String, DatabasePermissionSet) Enumerates a list of permissions in the database for the specified user and a specified permission set.
공용 메서드 EnumLocks() Enumerates a list of all current locks held on the database.
공용 메서드 EnumLocks(Int32) Enumerates a list of current locks held on the database for a specified system process ID.
공용 메서드 EnumLoginMappings Enumerates a list of SQL Server logins for all the users in the database.
공용 메서드 EnumMatchingSPs(String) Enumerates a list of stored procedures that contain the specified string in the definition.
공용 메서드 EnumMatchingSPs(String, Boolean) Enumerates a list of stored procedures that contain the specified string in the definition.
공용 메서드 EnumObjectPermissions() Enumerates a list of permissions for objects in the database.
공용 메서드 EnumObjectPermissions(String) Enumerates a list of permissions for objects in the database that belong to the specified user.
공용 메서드 EnumObjectPermissions(ObjectPermissionSet) Enumerates a list of permissions for objects in the database limited to the specified permission set.
공용 메서드 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() Enumerates a list of objects in the database.
공용 메서드 EnumObjects(DatabaseObjectTypes) Enumerates a list of objects in the database.
공용 메서드 EnumObjects(DatabaseObjectTypes, SortOrder) Enumerates a list of objects in the database.
공용 메서드 EnumTransactions() Enumerates a list of open transactions on the database.
공용 메서드 EnumTransactions(TransactionTypes) Enumerates a list of open transactions of a specified type on the database.
공용 메서드 EnumWindowsGroups() Enumerates a list of Windows groups.
공용 메서드 EnumWindowsGroups(String) Enumerates a list of Windows groups for a specified group.
공용 메서드 Equals (Object에서 상속됨)
공용 메서드 ExecuteNonQuery(StringCollection) Executes a batch in the context of the database where there are no results returned.
공용 메서드 ExecuteNonQuery(String) Executes a statement in the context of the database where there are no results returned.
공용 메서드 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.
공용 메서드 ExecuteNonQuery(String, ExecutionTypes) Executes a batch in the context of the database where there are no results returned for the specified execution type only.
공용 메서드 ExecuteWithResults(StringCollection) Executes a batch in the context of the database where there are results returned.
공용 메서드 ExecuteWithResults(String) Executes a collection of batches in the context of the database where there are results returned.
보호된 메서드 FormatSqlVariant Formats an object as SqlVariant type. (SqlSmoObject에서 상속됨)
보호된 메서드 GetContextDB Gets the context database that is associated with this object. (SqlSmoObject에서 상속됨)
보호된 메서드 GetDBName Gets the database name that is associated with the object. (SqlSmoObject에서 상속됨)
공용 메서드 GetHashCode (Object에서 상속됨)
보호된 메서드 GetPropValue Gets a property value of the SqlSmoObject object. (SqlSmoObject에서 상속됨)
보호된 메서드 GetPropValueOptional Gets a property value of the SqlSmoObject object. (SqlSmoObject에서 상속됨)
보호된 메서드 GetPropValueOptionalAllowNull Gets a property value of the SqlSmoObject object. (SqlSmoObject에서 상속됨)
보호된 메서드 GetServerObject Gets the server of the SqlSmoObject object. (SqlSmoObject에서 상속됨)
공용 메서드 GetTransactionCount() Gets the number of open transactions on the database.
공용 메서드 GetTransactionCount(TransactionTypes) Gets the number of open transactions of a specified type on the database.
공용 메서드 GetType (Object에서 상속됨)
공용 메서드 Grant(DatabasePermissionSet, String) Grants the specified set of permissions to the specified grantee on the database.
공용 메서드 Grant(DatabasePermissionSet, array<String[]) Grants the specified set of permissions to the specified grantees on the database.
공용 메서드 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, array<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) 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, array<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.
공용 메서드 Initialize() Initializes the object and forces the properties be loaded. (SqlSmoObject에서 상속됨)
공용 메서드 Initialize(Boolean) Initializes the object and forces the properties be loaded. (SqlSmoObject에서 상속됨)
공용 메서드 IsMember Determines whether the specified group or role belongs to the database.
보호된 메서드 IsObjectInitialized Verifies whether the object has been initialized. (SqlSmoObject에서 상속됨)
보호된 메서드 IsObjectInSpace Verifies whether the object is isolated or connected to the instance of SQL Server. (SqlSmoObject에서 상속됨)
공용 메서드 PrefetchObjects() Prefetches database objects.
공용 메서드 PrefetchObjects(Type) Prefetches database objects of a specified type.
공용 메서드 PrefetchObjects(Type, ScriptingOptions) Prefetches database objects of a specified type with scripting options.
공용 메서드 RecalculateSpaceUsage Recalculates space usage.
공용 메서드 Refresh Updates the Database object. (ScriptNameObjectBase.Refresh()을(를) 재정의함)
공용 메서드 RemoveFullTextCatalogs Removes full-text catalogs from the database.
공용 메서드 Rename Renames the database.
공용 메서드 Revoke(DatabasePermissionSet, String) Revokes a previously granted set of permissions from a grantee on the database.
공용 메서드 Revoke(DatabasePermissionSet, array<String[]) Revokes a previously granted set of permissions from a list of grantees on the database.
공용 메서드 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, array<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) 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, array<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() Generates a Transact-SQL script that can be used to re-create the database.
공용 메서드 Script(ScriptingOptions) Generates a Transact-SQL script that can be used to re-create the database as specified by the script options.
공용 메서드 SetDefaultFileGroup Sets the default file group for the database.
공용 메서드 SetDefaultFileStreamFileGroup Sets the default filestream group.
공용 메서드 SetDefaultFullTextCatalog Sets the default full-text catalog for the database.
공용 메서드 SetOffline Sets the database offline.
공용 메서드 SetOnline Sets the database online.
공용 메서드 SetOwner(String) Sets the database owner.
공용 메서드 SetOwner(String, Boolean) Sets the database owner.
보호된 메서드 SetParentImpl Sets the parent of the SqlSmoObject to the newParent parameter. (SqlSmoObject에서 상속됨)
공용 메서드 SetSnapshotIsolation Sets the snapshot isolation level.
공용 메서드 Shrink Shrinks the database.
공용 메서드 ToString Returns a String that represents the referenced object. (SqlSmoObject에서 상속됨)
공용 메서드 TruncateLog Truncates the database log.
공용 메서드 UpdateIndexStatistics Updates index statistics.
공용 메서드 Validate Validates the state of an object. (SmoObjectBase에서 상속됨)
공용 메서드 ValidateAllPlanGuides() Verifies the validity of the execution plans associated with the database.
공용 메서드 ValidateAllPlanGuides(DataTable%) Verifies the validity of the execution plans associated with the database and returns validation report.

맨 위로 이동

이벤트

  이름 설명
공용 이벤트 PropertyChanged Represents the event that occurs when a property is changed. (SqlSmoObject에서 상속됨)
공용 이벤트 PropertyMetadataChanged Represents the event that occurs when property metadata changes. (SqlSmoObject에서 상속됨)

맨 위로 이동

명시적 인터페이스 구현

  이름 설명
명시적 인터페이스 구현전용 메서드 IAlienObject.Discover Discovers any dependencies. 코드에서 직접 이 멤버를 참조하면 안 됩니다. 이 방법은 SQL Server 인프라를 지원합니다. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드 IAlienObject.GetDomainRoot Returns the root of the domain. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드 IAlienObject.GetParent Gets the parent of this object. 코드에서 직접 이 멤버를 참조하면 안 됩니다. 이 방법은 SQL Server 인프라를 지원합니다. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드 IAlienObject.GetPropertyType Gets the type of the specified property. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드 IAlienObject.GetPropertyValue Gets the value of the specified property. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드 IAlienObject.GetUrn Gets the Unified Resource Name (URN) of the object. 코드에서 직접 이 멤버를 참조하면 안 됩니다. 이 방법은 SQL Server 인프라를 지원합니다. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드 IAlienObject.Resolve Gets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드 IAlienObject.SetObjectState Sets the object state to the specified SfcObjectState value. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드 IAlienObject.SetPropertyValue Sets the property value. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드 ISfcPropertyProvider.GetPropertySet Gets the interface reference to the set of properties of this object. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 속성 ISfcSupportsDesignMode.IsDesignMode Gets a value that indicates whether the object supports design mode. 정보를 제공하기 위해서만 확인됩니다. 지원되지 않습니다. 향후 호환성은 보장되지 않습니다.

맨 위로 이동

주의

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

이 유형의 모든 public static(Microsoft Visual Basic의 경우 공유) 멤버는 다중 스레드 작업을 수행하기에 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.

VB

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Define a Database object variable by supplying the server and the database name arguments in the constructor.
Dim db As Database
db = New Database(srv, "Test_SMO_Database")
'Create the database on the instance of SQL Server.
db.Create()
'Reference the database and display the date when it was created.
db = srv.Databases("Test_SMO_Database")
Console.WriteLine(db.CreateDate)
'Remove the database.
db.Drop()

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()

스레드 보안

이 유형의 모든 공용 static(Visual Basic에서는 Shared) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.

참고 항목

참조

Microsoft.SqlServer.Management.Smo 네임스페이스

관련 자료

데이터베이스 개체 작업

데이터베이스 생성, 변경 및 제거

CREATE DATABASE(Transact-SQL)