Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Database Methods

The Database type exposes the following members.

  NameDescription
Protected method AddDatabaseContext(StringCollection) (Inherited from SqlSmoObject.)
Public method Alter() Updates any Database object property changes on the instance of SQL Server. 
Public method Alter(TimeSpan) Updates any Database object property changes on the instance of SQL Server. 
Public method Alter(TerminationClause) Updates any Database object property changes on the instance of SQL Server. 
Protected method AlterImpl() (Inherited from SqlSmoObject.)
Protected method AlterImplFinish(StringCollection, ScriptingOptions) (Inherited from SqlSmoObject.)
Protected method AlterImplInit(StringCollection, ScriptingOptions) (Inherited from SqlSmoObject.)
Protected method AlterImplWorker() (Inherited from SqlSmoObject.)
Protected method AppendCommaText(StringBuilder, String, Boolean, String) (Inherited from ScriptNameObjectBase.)
Protected method AppendWithCommaText(StringBuilder, String, Boolean) (Inherited from ScriptNameObjectBase.)
Protected method AppendWithOption(StringBuilder, String, String, Boolean) (Inherited from ScriptNameObjectBase.)
Protected method BindDefaultImpl(String, String, Boolean) (Inherited from SqlSmoObject.)
Protected method BindRuleImpl(String, String, Boolean) (Inherited from SqlSmoObject.)
Public method ChangeMirroringState(MirroringOption) Changes the mirroring configuration as specified by the options.
Public method CheckAllocations(RepairType) Scans all pages of the referenced database and tests pages to help ensure integrity.
Public method CheckAllocationsDataOnly() Scans all pages of the referenced database and tests only the data to help ensure integrity.
Public method CheckCatalog() Tests the integrity of the database catalog.
Protected method CheckCollation(String, ScriptingOptions) (Inherited from SqlSmoObject.)
Public method CheckIdentityValues() Verifies the integrity of all identity columns in tables in the database.
Protected method CheckObjectDirty() (Inherited from ScriptNameObjectBase.)
Protected method CheckObjectState() Validates the state of the referenced object. (Inherited from SqlSmoObject.)
Protected method 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.)
Protected method CheckObjectStateImpl(Boolean) (Inherited from SqlSmoObject.)
Public method Checkpoint() Issues a checkpoint.
Public method CheckTables(RepairType)
Public method CheckTables(RepairType, RepairOptions)
Public method CheckTables(RepairType, RepairStructure)
Public method CheckTables(RepairType, RepairOptions, RepairStructure)
Public method CheckTablesDataOnly() Tests integrity of data in pages that store data for all tables and indexes defined on the tables of the referenced database.
Public method 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.
Public method 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.
Public method 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.
Protected method CheckTextCorectness(String, Boolean, Boolean, String[], DdlTextParserHeaderInfo) (Inherited from ScriptNameObjectBase.)
Protected method CheckTextModeSupport() (Inherited from ScriptNameObjectBase.)
Protected method CheckVersion100() (Inherited from SqlSmoObject.)
Protected method CheckVersion80() Checks the validity of the object on SQL Server 2000. (Inherited from SqlSmoObject.)
Protected method CheckVersion80SP3() Checks the validity of the object on SQL Server 2000 SP3. (Inherited from SqlSmoObject.)
Protected method CheckVersion90() Check the validity of the object on SQL Server 2005. (Inherited from SqlSmoObject.)
Protected method CheckVersionBelow90() (Inherited from SqlSmoObject.)
Protected method CleanObject() Cleans the referenced object. (Inherited from ScriptNameObjectBase.)
Public method Create() Creates a database on the instance of SQL Server as defined by the Database object.
Public method Create(Boolean) Creates a database on the instance of SQL Server as defined by the Database object.
Protected method CreateImpl() (Inherited from SqlSmoObject.)
Protected method CreateImplFinish(StringCollection, ScriptingOptions) (Inherited from SqlSmoObject.)
Protected method CreateImplInit(StringCollection, ScriptingOptions) (Inherited from SqlSmoObject.)
Public method Deny(DatabasePermissionSet, String) Denies the specified set of permissions for the specified grantee on the database.
Public method Deny(DatabasePermissionSet, String[]) Denies the specified set of permissions for the specified grantees on the database.
Public method 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.
Public method 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.
Public method DisableAllPlanGuides() Disables all Plan Guides in a database.
Public method Discover() (Inherited from SqlSmoObject.)
Public method Drop() Drops the database.
Public method DropAllPlanGuides() Drops all Plan Guides in a database.
Public method DropBackupHistory() Drops the backup history for the database.
Protected method DropImpl() (Inherited from SqlSmoObject.)
Protected method DropImplWorker(Urn) (Inherited from SqlSmoObject.)
Public method EnableAllPlanGuides() Enables all Plan Guides in a database.
Public method EnumBackupSetFiles() Returns a DataTable listing files contained in a backup set.
Public method EnumBackupSetFiles(Int32) Returns a Data table that lists the files in a backup set
Public method EnumBackupSets() Returns a DataTable listing the backup sets associated with a database.
Public method EnumCandidateKeys() Enumerates a list of all candidate primary keys in the database, which can be referenced by a foreign key.
Public method EnumDatabasePermissions() Enumerates a list of all permissions in the database.
Public method EnumDatabasePermissions(String) Enumerates a list of permissions in the database for the specified user.
Public method EnumDatabasePermissions(DatabasePermissionSet) Enumerates a list of permissions in the database for the specified permission set.
Public method EnumDatabasePermissions(String, DatabasePermissionSet) Enumerates a list of permissions in the database for the specified user and a specified permission set.
Public method EnumLocks() Enumerates a list of all current locks held on the database.
Public method EnumLocks(Int32) Enumerates a list of current locks held on the database for a specified system process ID.
Public method EnumLoginMappings() Enumerates a list of SQL Server logins for all the users in the database.
Public method EnumMatchingSPs(String) Enumerates a list of stored procedures that contain the specified string in the definition.
Public method EnumMatchingSPs(String, Boolean) Enumerates a list of stored procedures that contain the specified string in the definition.
Public method EnumObjectPermissions() Enumerates a list of permissions for objects in the database.
Public method EnumObjectPermissions(String) Enumerates a list of permissions for objects in the database that belong to the specified user.
Public method EnumObjectPermissions(ObjectPermissionSet) Enumerates a list of permissions for objects in the database limited to the specified permission set.
Public method 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.
Public method EnumObjects() Enumerates a list of objects in the database.
Public method EnumObjects(DatabaseObjectTypes) Enumerates a list of objects in the database.
Public method EnumObjects(DatabaseObjectTypes, SortOrder) Enumerates a list of objects in the database.
Protected method EnumScriptImpl(ScriptingOptions) (Inherited from SqlSmoObject.)
Protected method EnumScriptImplWorker(ScriptingOptions) (Inherited from SqlSmoObject.)
Public method EnumTransactions() Enumerates a list of open transactions on the database.
Public method EnumTransactions(TransactionTypes) Enumerates a list of open transactions of a specified type on the database.
Public method EnumWindowsGroups() Enumerates a list of Windows groups.
Public method EnumWindowsGroups(String) Enumerates a list of Windows groups for a specified group.
Public method Equals(Object) (Inherited from Object.)
Public method ExecuteNonQuery(StringCollection) Executes a batch in the context of the database where there are no results returned.
Public method ExecuteNonQuery(String) Executes a statement in the context of the database where there are no results returned.
Public method 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.
Public method ExecuteNonQuery(String, ExecutionTypes) Executes a batch in the context of the database where there are no results returned for the specified execution type only.
Public method ExecuteWithResults(StringCollection) Executes a batch in the context of the database where there are results returned.
Public method ExecuteWithResults(String) Executes a collection of batches in the context of the database where there are results returned.
Protected method Finalize() (Inherited from Object.)
Protected method ForceTextModeOnTextBody() Enforces text mode on the text body. (Inherited from ScriptNameObjectBase.)
Protected method FormatSqlVariant(Object) (Inherited from SqlSmoObject.)
Protected method GenerateDataSpaceFileStreamScript(StringBuilder, ScriptingOptions, Boolean) (Inherited from SqlSmoObject.)
Protected method GenerateDataSpaceScript(StringBuilder, ScriptingOptions) (Inherited from SqlSmoObject.)
Protected method GetBindDefaultScript(ScriptingOptions, String, String, Boolean) (Inherited from SqlSmoObject.)
Protected method GetBindRuleScript(ScriptingOptions, String, String, Boolean) (Inherited from SqlSmoObject.)
Protected method GetBoolParameter(StringBuilder, ScriptingOptions, String, String, Int32) (Inherited from SqlSmoObject.)
Protected method GetBoolParameter(StringBuilder, ScriptingOptions, String, String, Int32, Boolean) (Inherited from SqlSmoObject.)
Protected method GetBraketNameForText() (Inherited from ScriptNameObjectBase.)
Protected method GetDateTimeParameter(StringBuilder, ScriptingOptions, String, String, Int32) (Inherited from SqlSmoObject.)
Protected method GetDateTimeParameterAsInt(StringBuilder, ScriptingOptions, String, String, Int32) (Inherited from SqlSmoObject.)
Protected method GetDBName() Gets the database name that is associated with the object. (Inherited from SqlSmoObject.)
Protected method GetEnumParameter(StringBuilder, ScriptingOptions, String, String, Type, Int32) (Inherited from SqlSmoObject.)
Protected method GetFragOptionString(FragmentationOption) (Inherited from SqlSmoObject.)
Protected method GetGuidParameter(StringBuilder, ScriptingOptions, String, String, Int32) (Inherited from SqlSmoObject.)
Public method GetHashCode() (Inherited from Object.)
Protected method GetIsTextDirty() Determines whether the text value is consistent with stored value. (Inherited from ScriptNameObjectBase.)
Protected method GetParameter(StringBuilder, ScriptingOptions, String, String, Int32) (Inherited from SqlSmoObject.)
Protected method GetParameter(StringBuilder, ScriptingOptions, String, String, Int32, Boolean) (Inherited from SqlSmoObject.)
Protected method GetPropValue(String) (Inherited from SqlSmoObject.)
Protected method GetPropValueOptional(String) (Inherited from SqlSmoObject.)
Protected method GetPropValueOptionalAllowNull(String) (Inherited from SqlSmoObject.)
Protected method GetRealValue(Property, Object) (Inherited from SqlSmoObject.)
Protected method GetScriptIncludeExists(ScriptingOptions, String, Boolean) (Inherited from ScriptNameObjectBase.)
Protected method GetScriptingOptionsForCreate() (Inherited from SqlSmoObject.)
Protected method GetServerName() Gets the name of the instance of SQL Server with which the object is associated. (Inherited from SqlSmoObject.)
Protected method GetServerObject() (Inherited from SqlSmoObject.)
Protected method GetSqlServerVersionName() Gets the version name of the instance of SQL Server with which the object is associated. (Inherited from SqlSmoObject.)
Protected method GetStringParameter(StringBuilder, ScriptingOptions, String, String, Int32) (Inherited from SqlSmoObject.)
Protected method GetStringParameter(StringBuilder, ScriptingOptions, String, String, Int32, Boolean) (Inherited from SqlSmoObject.)
Protected method GetTextBody() Returns the text body. (Inherited from ScriptNameObjectBase.)
Protected method GetTextBody(Boolean) Returns the text body. (Inherited from ScriptNameObjectBase.)
Protected method GetTextForScript(ScriptingOptions, Boolean, String[]) Gets the text for scripting. (Inherited from ScriptNameObjectBase.)
Protected method GetTextForScript(ScriptingOptions, Boolean, String[], Boolean) (Inherited from ScriptNameObjectBase.)
Protected method GetTextHeader(Boolean) Returns the text header. (Inherited from ScriptNameObjectBase.)
Protected method GetTextMode() Determines whether the script name is using text mode. (Inherited from ScriptNameObjectBase.)
Protected method GetTextProperty(String) (Inherited from ScriptNameObjectBase.)
Protected method GetTextProperty(String, ScriptingOptions) (Inherited from ScriptNameObjectBase.)
Protected method GetTimeSpanParameterAsInt(StringBuilder, ScriptingOptions, String, String, Int32) (Inherited from SqlSmoObject.)
Public method GetTransactionCount() Gets the number of open transactions on the database.
Public method GetTransactionCount(TransactionTypes) Gets the number of open transactions of a specified type on the database.
Public method GetType() (Inherited from Object.)
Protected method GetUrnRecursive(StringBuilder) (Inherited from SqlSmoObject.)
Protected method GetUrnRecursive(StringBuilder, UrnIdOption) (Inherited from SqlSmoObject.)
Public method Grant(DatabasePermissionSet, String) Grants the specified set of permissions to the specified grantee on the database.
Public method Grant(DatabasePermissionSet, String[]) Grants the specified set of permissions to the specified grantees on the database.
Public method 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.
Public method 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.
Public method 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.
Public method 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.
Protected method ImplInitialize(String[], OrderBy[]) (Inherited from SqlSmoObject.)
Public method Initialize() Initializes the object and forces the properties be loaded. (Inherited from SqlSmoObject.)
Public method Initialize(Boolean) Initializes the object and forces the properties be loaded. (Inherited from SqlSmoObject.)
Public method IsMember(String) Determines whether the specified group or role belongs to the database.
Protected method IsObjectDirty() Determines whether the referenced object is consistent with the stored object. (Inherited from ScriptNameObjectBase.)
Protected method IsObjectInitialized() Verifies whether the object has been initialized. (Inherited from SqlSmoObject.)
Protected method IsObjectInSpace() Verifies whether the object is isolated or connected to the instance of SQL Server. (Inherited from SqlSmoObject.)
Protected method IsVersion80SP3() (Inherited from SqlSmoObject.)
Protected method MarkDropped() (Inherited from SqlSmoObject.)
Protected method MarkForDropImpl(Boolean) (Inherited from SqlSmoObject.)
Protected method MemberwiseClone() (Inherited from Object.)
Protected method PostAlter() (Inherited from SqlSmoObject.)
Protected method PostCreate() (Inherited from SqlSmoObject.)
Protected method PostDrop() (Inherited from SqlSmoObject.)
Public method PrefetchObjects() Prefetches database objects.
Public method PrefetchObjects(Type) Prefetches database objects of a specified type.
Public method PrefetchObjects(Type, ScriptingOptions) Prefetches database objects of a specified type with scripting options.
Public method RecalculateSpaceUsage() Recalculates space usage.
Public method Refresh() Updates the Database object. (Overrides ScriptNameObjectBase.Refresh().)
Public method RemoveFullTextCatalogs() Removes full-text catalogs from the database.
Public method Rename(String) Renames the database.
Protected method RenameImpl(String) This method supports the SMO infrastructure and is not intended to be used directly from your code. (Inherited from NamedSmoObject.)
Protected method RenameImplWorker(String) This method supports the SMO infrastructure and is not intended to be used directly from your code. (Inherited from NamedSmoObject.)
Public method Revoke(DatabasePermissionSet, String) Revokes a previously granted set of permissions from a grantee on the database.
Public method Revoke(DatabasePermissionSet, String[]) Revokes a previously granted set of permissions from a list of grantees on the database.
Public method 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.
Public method 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.
Public method 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.
Public method 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.
Public method Script() Generates a Transact-SQL script that can be used to re-create the database.
Public method Script(ScriptingOptions) Generates a Transact-SQL script that can be used to re-create the database as specified by the script options.
Protected method ScriptAlter(StringCollection, ScriptingOptions) (Inherited from SqlSmoObject.)
Protected method ScriptAnsiQI(SqlSmoObject, ScriptingOptions, StringCollection, StringBuilder, Object, Object) (Inherited from ScriptNameObjectBase.)
Protected method ScriptChangeOwner(StringCollection, ScriptingOptions) This method supports the SMO infrastructure and is not intended to be used directly from your code. (Inherited from NamedSmoObject.)
Protected method ScriptCreate(StringCollection, ScriptingOptions) (Inherited from SqlSmoObject.)
Protected method ScriptDdl(StringCollection, ScriptingOptions) (Inherited from SqlSmoObject.)
Protected method ScriptDrop(StringCollection, ScriptingOptions) (Inherited from SqlSmoObject.)
Protected method ScriptImpl() (Inherited from SqlSmoObject.)
Protected method ScriptImpl(ScriptingOptions) (Inherited from SqlSmoObject.)
Protected method ScriptImplWorker(ScriptingOptions) (Inherited from SqlSmoObject.)
Protected method ScriptInformativeHeaders(ScriptingOptions, StringBuilder) (Inherited from ScriptNameObjectBase.)
Protected method ScriptRename(StringCollection, ScriptingOptions, String) This method supports the SMO infrastructure and is not intended to be used directly from your code. (Inherited from NamedSmoObject.)
Protected method SetCollectionTextMode(Boolean, SmoCollectionBase) Sets the collection text mode. (Inherited from ScriptNameObjectBase.)
Public method SetDefaultFileGroup(String) Sets the default file group for the database.
Public method SetDefaultFileStreamFileGroup(String) Sets the default filestream group.
Public method SetDefaultFullTextCatalog(String) Sets the default full-text catalog for the database.
Public method SetOffline() Sets the database offline.
Public method SetOnline() Sets the database online.
Public method SetOwner(String) Sets the database owner.
Public method SetOwner(String, Boolean) Sets the database owner.
Protected method SetParentImpl(SqlSmoObject) (Inherited from SqlSmoObject.)
Public method SetSnapshotIsolation(Boolean) Sets the snapshot isolation level.
Protected method SetTextBody(String) Specifies the text body. (Inherited from ScriptNameObjectBase.)
Protected method SetTextHeader(String) Specifies the text header. (Inherited from ScriptNameObjectBase.)
Protected method SetTextMode(Boolean, SmoCollectionBase[]) Specifies the text mode. (Inherited from ScriptNameObjectBase.)
Public method Shrink(Int32, ShrinkMethod) Shrinks the database.
Protected method SwitchTextMode(Boolean, SmoCollectionBase[]) Switches the text mode. (Inherited from ScriptNameObjectBase.)
Protected method ThrowIfTextIsDirtyForAlter() (Inherited from ScriptNameObjectBase.)
Public method ToString() Returns a String that represents the referenced object. (Inherited from SqlSmoObject.)
Protected method TouchImpl() (Inherited from SqlSmoObject.)
Public method TruncateLog() Truncates the database log.
Protected method UnbindDefaultImpl(Boolean) (Inherited from SqlSmoObject.)
Protected method UnbindRuleImpl(Boolean) (Inherited from SqlSmoObject.)
Public method UpdateIndexStatistics() Updates index statistics.
Public method Validate(String, Object[]) (Inherited from SmoObjectBase.)
Public method ValidateAllPlanGuides() Verifies the validity of the execution plans associated with the database.
Public method ValidateAllPlanGuides(DataTable)
Top
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.