문서를 영문으로 보려면 영문 확인란을 선택하세요. 마우스 포인터를 텍스트 위로 이동시켜 팝업 창에서 영문 텍스트를 표시할 수도 있습니다.
번역
영문

Database 클래스

Represents an SQL Server database.

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

[PhysicalFacetAttribute]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)]
public sealed class Database : ScriptNameObjectBase, 
	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.
맨 위로 이동

  이름설명
공용 속성ActiveConnectionsGets the number of active connections to the database.
공용 속성ActiveDirectory 더 이상 사용되지 않습니다. Gets the information about the Active Directory settings for the database.
공용 속성AnsiNullDefaultGets or sets a value that specifies whether the ANSI_NULL_DEFAULT database option is active.
공용 속성AnsiNullsEnabledGets or sets a value that specifies whether the ANSI_NULLS_ENABLED database option is active.
공용 속성AnsiPaddingEnabledGets or sets a value that specifies whether the ANSI_PADDING_ENABLED database option is active.
공용 속성AnsiWarningsEnabledGets or sets a value that specifies whether the ANSI_WARNINGS_ENABLED database option is active.
공용 속성ApplicationRolesGets a collection of ApplicationRole objects. Each ApplicationRole object represents an application role defined on the database.
공용 속성ArithmeticAbortEnabledGets or sets a value that specifies whether the ARITHMETICABORT database option is active.
공용 속성AssembliesGets a collection of SqlAssembly objects. Each SqlAssembly object represents an assembly defined on the database.
공용 속성AsymmetricKeysGets a collection of AsymmetricKey objects. Each AsymmetricKey object represents an asymmetric key defined on the database.
공용 속성AutoCloseGets or sets a value that specifies whether the AUTOCLOSE database option is set.
공용 속성AutoCreateStatisticsEnabledGets a value that specifies whether statistics are automatically created for the database.
공용 속성AutoShrinkGets or sets a value that specifies whether the AUTO_SHRINK database option is active.
공용 속성AutoUpdateStatisticsAsyncGets or sets a value that specifies whether the AUTOUPDATESTATISTICSASYNC database option is active.
공용 속성AutoUpdateStatisticsEnabledGets or sets a value that specifies whether statistics are automatically updated for the database.
공용 속성AvailabilityDatabaseSynchronizationStateGets the synchronization state of the availability database.
공용 속성AvailabilityGroupNameGets the availability group name in the database.
공용 속성BrokerEnabledGets or sets a value that specifies whether the Service Broker service is enabled.
공용 속성CaseSensitiveGets a value that specifies whether uppercase letters and lowercase letters are evaluated as equal.
공용 속성CertificatesGets a collection of Certificate objects. Each Certificate object represents a certificate defined on the database.
공용 속성ChangeTrackingAutoCleanUpGets or sets a value that specifies whether the CHANGE_TRACKING_AUTO_CLEANUP OPTION is enabled.
공용 속성ChangeTrackingEnabledGets or sets a value that specifies whether the CHANGE_TRACKING_VALUE option is enabled
공용 속성ChangeTrackingRetentionPeriodGets or sets the CHANGE_TRACKING_RETENTION_PERIOD value.
공용 속성ChangeTrackingRetentionPeriodUnitsGets or sets the unit type for a retention period value.
공용 속성CloseCursorsOnCommitEnabledGets or sets a value that specifies whether the CURSOR_CLOSE_ON_COMMIT database option is active.
공용 속성CollationGets or sets the default collation used by the database.
공용 속성CompatibilityLevelGets or sets the compatibility level for the database.
공용 속성ConcatenateNullYieldsNullGets or sets a value that specifies whether the CONCAT_NULL_YIELDS_NULL database option is active.
공용 속성ContainmentTypeGets or sets the type of containment.
공용 속성CreateDateGets the date that the database was created.
공용 속성DatabaseAuditSpecificationsGets a collection of DatabaseAuditSpecification objects. Each DatabaseAuditSpecification object represents a database audit specification defined on the server.
공용 속성DatabaseEncryptionKeyGets a DataBaseEncryptionKey data type.
공용 속성DatabaseGuidGets the Guid value that uniquely identifies the database.
공용 속성DatabaseOptionsGets the DatabaseOptions object that contains configuration options for the database.
공용 속성DatabaseOwnershipChainingGets or sets a value that specifies whether the database ownership chaining is active.
공용 속성DatabaseSnapshotBaseNameGets the name of the snapshot base for the database.
공용 속성DataSpaceUsageGets the space used by the data in the database.
공용 속성DateCorrelationOptimizationGets or sets a value that specifies whether the date correlation optimization is active.
공용 속성DboLoginGets a value that specifies whether the current user is logged on as the database owner (DBO).
공용 속성DefaultFileGroupGets the default file group used by the database.
공용 속성DefaultFileStreamFileGroupGets the file group name for the default file stream.
공용 속성DefaultFullTextCatalogGets the default full-text catalog used by the database.
공용 속성DefaultFullTextLanguageGets the default full text language.
공용 속성DefaultLanguageGets or sets the default language.
공용 속성DefaultsGets a collection of Default objects. Each Default object represents a default defined on the database.
공용 속성DefaultSchemaGets the default schema of the user.
공용 속성EncryptionEnabledGets or sets a value that indicates whether the data encryption is enabled.
공용 속성EventsGets the events associated with the database.
공용 속성ExtendedPropertiesGets the extended properties of the database.
공용 속성ExtendedStoredProceduresGets a collection of ExtendedStoredProcedure objects. Each ExtendedStoredProcedure object represents an extended stored procedure defined on the database.
공용 속성FederationsGets a collection of Federation objects. Each Federation represents a data being partitioned on the database.
공용 속성FileGroupsGets a collection of FileGroup objects. Each FileGroup object represents a file group defined on the database.
공용 속성FilestreamDirectoryNameGets or sets the name of file stream share directory.
공용 속성FilestreamNonTransactedAccessGets or sets the file stream non-transacted access setting for database.
공용 속성FullTextCatalogsGets a collection of FullTextCatalog objects. Each FullTextCatalog object represents a full-text catalog defined on the database.
공용 속성FullTextStopListsGets a collection of FullTextStopList objects. Each FullTextStopList object represents a full text stop list defined on the server.
공용 속성HonorBrokerPriorityGets or sets a value that specifies whether the priority specified by the broker is acknowledged or not.
공용 속성IDGets the database ID value that uniquely identifies the database.
공용 속성IndexSpaceUsageGets the space used by the indexes in the database.
공용 속성IsAccessibleGets a value that specifies whether the database can be accessed.
공용 속성IsDatabaseSnapshotGets a value that specifies whether the database is a snapshot database.
공용 속성IsDatabaseSnapshotBaseGets a value that specifies whether the database is the base database for a snapshot database.
공용 속성IsDbAccessAdminGets a value that specifies whether the current user is a member of the DbAccessAdmin database role.
공용 속성IsDbBackupOperatorGets a value that specifies whether the current user is a member of the DbBackupOperator database role.
공용 속성IsDbDatareaderGets a value that specifies whether the current user is a member of the DbDatareader database role.
공용 속성IsDbDatawriterGets a value that specifies whether the current user is a member of the DbDatawriter database role.
공용 속성IsDbDdlAdminGets a value that specifies whether the current user is a member of the DbDdlAdmin database role.
공용 속성IsDbDenyDatareaderGets a value that specifies whether the current user is a member of the DbDenyDatareader database role.
공용 속성IsDbDenyDatawriterGets a value that specifies whether the current member is a member of the DbDenyDatawriter database.
공용 속성IsDbManagerGets a value that specifies whether the current login is a database manager in SQL 데이터베이스.
공용 속성IsDbOwnerGets a value that specifies whether the current user is a member of the DbOwner database role.
공용 속성IsDbSecurityAdminGets a value that specifies whether the current user is a member of the DbSecurityAdmin database role.
공용 속성IsFederationMemberGets or sets a value that specifies whether the database is a member of federation.
공용 속성IsFullTextEnabledGets or sets a value that specifies whether the database is enabled for full-text search.
공용 속성IsLoginManagerGets a value that specifies whether the current login is a login manager in SQL 데이터베이스.
공용 속성IsMailHostGets a value that specifies whether the database is configured as a mail host.
공용 속성IsManagementDataWarehouseGets a value that specifies whether the database is a management data warehouse.
공용 속성IsMirroringEnabledGets a value that specifies whether mirroring is enabled on the database.
공용 속성IsParameterizationForcedGets or sets a value that specifies whether parameterization is forced on the database.
공용 속성IsReadCommittedSnapshotOnGets or sets a value that specifies whether transactions with the read committed isolation level use row versioning.
공용 속성IsSystemObjectGets a value that specifies whether the database is a system object or a user-defined database.
공용 속성IsUpdateableGets a value that specifies whether the database can be updated.
공용 속성IsVarDecimalStorageFormatEnabledGets or sets a value that specifies whether VarDecimal storage is enabled.
공용 속성LastBackupDateGets the date and time when the database was last backed up.
공용 속성LastDifferentialBackupDateGets the date and time when the last differential backup was performed.
공용 속성LastLogBackupDateGets the date and time when the transaction log was last backed up.
공용 속성LocalCursorsDefaultGets or sets a value that specifies whether the local server cursors are used by default.
공용 속성LogFilesGets a collection of LogFile objects. Each LogFile object represents a log file defined on the database.
공용 속성LogReuseWaitStatusGets the type of operation on which the reuse of transaction log space is waiting.
공용 속성MasterKeyGets the master key that is used to encrypt the private keys of certificates.
공용 속성MirroringFailoverLogSequenceNumberGets the log sequence number at last failover.
공용 속성MirroringIDGets the ID value that uniquely identifies the mirroring partnership.
공용 속성MirroringPartnerGets or sets the address of the 데이터베이스 엔진 instance that is the partner server for database mirroring.
공용 속성MirroringPartnerInstanceGets the instance of SQL Server on which the mirroring partner is configured.
공용 속성MirroringRedoQueueMaxSizeGets the maximum size of the redo queue of the mirror server instance in KB.
공용 속성MirroringRoleSequenceGets the role sequence number for primary/backup roles played by the mirroring partners.
공용 속성MirroringSafetyLevelGets or sets the mirroring safety level.
공용 속성MirroringSafetySequenceGets the role sequence number for safety levels for the mirroring partners.
공용 속성MirroringStatusGets the status of the database and the database mirroring session.
공용 속성MirroringTimeoutGets 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.
공용 속성MirroringWitnessGets or sets the name of the 데이터베이스 엔진 instance of the database mirroring witness server.
공용 속성MirroringWitnessStatusGets the status of the mirroring witness server.
공용 속성NameGets or sets the name of the database. (NamedSmoObject.Name을(를) 재정의함)
공용 속성NestedTriggersEnabledGets or sets a value that indicates whether the nested triggers are enabled.
공용 속성NumericRoundAbortEnabledGets or sets a value that specifies whether the NUMERIC_ROUNDABORT database option is active.
공용 속성OwnerGets the database principal that is the owner of the database.
공용 속성PageVerifyGets or sets the type of page integrity check that SQL Server performs when reading database pages.
공용 속성ParentGets or sets the Server object that is the parent of the Database object.
공용 속성PartitionFunctionsGets a collection of PartitionFunction objects. Each PartitionFunction object represents a partition function defined on the database.
공용 속성PartitionSchemesGets a collection of PartitionScheme objects. Each PartitionScheme object represents a partition scheme defined on the database.
공용 속성PlanGuidesGets a collection of plan guides associated with a database.
공용 속성PrimaryFilePathGets the operating system directory that contains the primary file for the database.
공용 속성PropertiesGets a collection of Property objects that represent the object properties. (SqlSmoObject에서 상속됨)
공용 속성QuotedIdentifiersEnabledGets 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.
공용 속성ReadOnlyGets or sets a value that specifies whether the database is read-only.
공용 속성RecoveryForkGuidGets the GUID value that specifies the recovery fork on which the database is currently active.
공용 속성RecoveryModelGets or sets the recovery model for the database.
공용 속성RecursiveTriggersEnabledGets or sets a value that specifies whether recursive triggers are enabled on the database.
공용 속성ReplicationOptionsGets the active replication settings for a database.
공용 속성RolesGets a collection of DatabaseRole objects. Each DatabaseRole object represents a role defined on the database.
공용 속성RulesGets a collection of Rule objects. Each Rule object represents a rule defined on the database.
공용 속성SchemasGets a collection of Schema objects. Each Schema object represents a schema defined on the database.
공용 속성SearchPropertyListsGets the SearchPropertyListCollection associated with this object.
공용 속성SequencesGets the SequenceCollection associated with this object.
공용 속성ServiceBrokerGets the ServiceBroker object that represents the Service Broker.
공용 속성ServiceBrokerGuidGets the Guid object that uniquely identifies the instance of Service Broker.
공용 속성SizeGets the size of the database in MB.
공용 속성SnapshotIsolationStateGets the snapshot isolation state for the database.
공용 속성SpaceAvailableGets the available space in the database in KB.
공용 속성StateGets the state of the referenced object. (SmoObjectBase에서 상속됨)
공용 속성StatusGets the database status.
공용 속성StoredProceduresGets a collection of StoredProcedure objects. Each StoredProcedure object represents a stored procedure defined on the database.
공용 속성SymmetricKeysGets a collection of SymmetricKey objects. Each SymmetricKey object represents a symmetric key defined on the database.
공용 속성SynonymsGets a collection of Synonym objects. Each Synonym object represents a synonym defined on the database.
공용 속성TablesGets a collection of Table objects. Each Table object represents a table defined on the database.
공용 속성TargetRecoveryTimeGets or sets the target recovery time of the used database.
공용 속성TransformNoiseWordsGets a value that indicates whether an object that sets the transform noise words configuration option is used.
공용 속성TriggersGets a collection of DatabaseDdlTrigger objects. Each DatabaseDdlTrigger object represents a trigger defined on the database.
공용 속성TrustworthyGets or sets a value that indicates whether the instance of SQL Server 2005 trusts the database and the contents within it.
공용 속성TwoDigitYearCutoffGets or sets the specified object that is used to set the two digit year cutoff configuration option.
공용 속성UrnGets the Uniform Resource Name (URN) address value that uniquely identifies the object. (SqlSmoObject에서 상속됨)
공용 속성UserAccessGets or sets the database user access.
공용 속성UserDataGets or sets user-defined data associated with the referenced object. (SmoObjectBase에서 상속됨)
공용 속성UserDefinedAggregatesGets a collection of UserDefinedAggregate objects. Each UserDefinedAggregate object represents a user-defined aggregate defined on the database.
공용 속성UserDefinedDataTypesGets a collection of UserDefinedDataType objects. Each UserDefinedDataType object represents a user-defined data type on the database.
공용 속성UserDefinedFunctionsGets a collection of UserDefinedFunction objects. Each UserDefinedFunction object represents a user-defined function on the database.
공용 속성UserDefinedTableTypesGets a collection of UserDefinedTableType objects. Each UserDefinedTableType object represents a user-defined table type on the database.
공용 속성UserDefinedTypesGets a collection of UserDefinedType objects. Each UserDefinedType object represents a user-defined type on the database.
공용 속성UserNameGets the database user name.
공용 속성UsersGets a collection of User objects. Each User object represents a user who is defined on the database.
공용 속성VersionGets the version of the instance of SQL Server that was used to create the database.
공용 속성ViewsGets a collection of View objects. Each View object represents a view defined on the database.
공용 속성XmlSchemaCollectionsGets 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. 
공용 메서드ChangeMirroringStateChanges the mirroring configuration as specified by the options.
공용 메서드CheckAllocationsScans all pages of the referenced database and tests pages to help ensure integrity.
공용 메서드CheckAllocationsDataOnlyScans all pages of the referenced database and tests only the data to help ensure integrity.
공용 메서드CheckCatalogTests the integrity of the database catalog.
공용 메서드CheckIdentityValuesVerifies the integrity of all identity columns in tables in the database.
공용 메서드CheckpointIssues 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, 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, 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.
공용 메서드DisableAllPlanGuidesDisables all Plan Guides in a database.
공용 메서드DiscoverDiscovers a list of type Object. (SqlSmoObject에서 상속됨)
공용 메서드DropDrops the database.
공용 메서드DropAllPlanGuidesDrops all Plan Guides in a database.
공용 메서드DropBackupHistoryDrops the backup history for the database.
공용 메서드EnableAllPlanGuidesEnables 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
공용 메서드EnumBackupSetsReturns a DataTable listing the backup sets associated with a database.
공용 메서드EnumCandidateKeysEnumerates 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.
공용 메서드EnumLoginMappingsEnumerates 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.
보호된 메서드FormatSqlVariantFormats an object as SqlVariant type. (SqlSmoObject에서 상속됨)
보호된 메서드GetContextDBGets the context database that is associated with this object. (SqlSmoObject에서 상속됨)
보호된 메서드GetDBNameGets the database name that is associated with the object. (SqlSmoObject에서 상속됨)
공용 메서드GetHashCode (Object에서 상속됨)
보호된 메서드GetPropValueGets a property value of the SqlSmoObject object. (SqlSmoObject에서 상속됨)
보호된 메서드GetPropValueOptionalGets a property value of the SqlSmoObject object. (SqlSmoObject에서 상속됨)
보호된 메서드GetPropValueOptionalAllowNullGets a property value of the SqlSmoObject object. (SqlSmoObject에서 상속됨)
보호된 메서드GetServerObjectGets 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, 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, 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, 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에서 상속됨)
공용 메서드IsMemberDetermines whether the specified group or role belongs to the database.
보호된 메서드IsObjectInitializedVerifies whether the object has been initialized. (SqlSmoObject에서 상속됨)
보호된 메서드IsObjectInSpaceVerifies 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.
공용 메서드RecalculateSpaceUsageRecalculates space usage.
공용 메서드RefreshUpdates the Database object. (ScriptNameObjectBase.Refresh()을(를) 재정의함)
공용 메서드RemoveFullTextCatalogsRemoves full-text catalogs from the database.
공용 메서드RenameRenames the database.
공용 메서드Revoke(DatabasePermissionSet, String)Revokes a previously granted set of permissions from a grantee on the database.
공용 메서드Revoke(DatabasePermissionSet, 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, 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, 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.
공용 메서드SetDefaultFileGroupSets the default file group for the database.
공용 메서드SetDefaultFileStreamFileGroupSets the default filestream group.
공용 메서드SetDefaultFullTextCatalogSets the default full-text catalog for the database.
공용 메서드SetOfflineSets the database offline.
공용 메서드SetOnlineSets the database online.
공용 메서드SetOwner(String)Sets the database owner.
공용 메서드SetOwner(String, Boolean)Sets the database owner.
보호된 메서드SetParentImplSets the parent of the SqlSmoObject to the newParent parameter. (SqlSmoObject에서 상속됨)
공용 메서드SetSnapshotIsolationSets the snapshot isolation level.
공용 메서드ShrinkShrinks the database.
공용 메서드ToStringReturns a String that represents the referenced object. (SqlSmoObject에서 상속됨)
공용 메서드TruncateLogTruncates the database log.
공용 메서드UpdateIndexStatisticsUpdates index statistics.
공용 메서드ValidateValidates 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.
맨 위로 이동

  이름설명
공용 이벤트PropertyChangedRepresents the event that occurs when a property is changed. (SqlSmoObject에서 상속됨)
공용 이벤트PropertyMetadataChangedRepresents the event that occurs when property metadata changes. (SqlSmoObject에서 상속됨)
맨 위로 이동

  이름설명
명시적 인터페이스 구현전용 메서드IAlienObject.DiscoverDiscovers any dependencies. 코드에서 직접 이 멤버를 참조하면 안 됩니다. 이 방법은 SQL Server 인프라를 지원합니다. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드IAlienObject.GetDomainRootReturns the root of the domain. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드IAlienObject.GetParentGets the parent of this object. 코드에서 직접 이 멤버를 참조하면 안 됩니다. 이 방법은 SQL Server 인프라를 지원합니다. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드IAlienObject.GetPropertyTypeGets the type of the specified property. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드IAlienObject.GetPropertyValueGets the value of the specified property. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드IAlienObject.GetUrnGets the Unified Resource Name (URN) of the object. 코드에서 직접 이 멤버를 참조하면 안 됩니다. 이 방법은 SQL Server 인프라를 지원합니다. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드IAlienObject.ResolveGets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드IAlienObject.SetObjectStateSets the object state to the specified SfcObjectState value. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드IAlienObject.SetPropertyValueSets the property value. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 메서드ISfcPropertyProvider.GetPropertySetGets the interface reference to the set of properties of this object. (SqlSmoObject에서 상속됨)
명시적 인터페이스 구현전용 속성ISfcSupportsDesignMode.IsDesignModeGets 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) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.

커뮤니티 추가 항목

추가
표시: