Database Methods
SQL Server 2008
The Database type exposes the following members.
| Name | Description | |
|---|---|---|
|
AddDatabaseContext(StringCollection) | (Inherited from SqlSmoObject.) |
|
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. |
|
AlterImpl() | (Inherited from SqlSmoObject.) |
|
AlterImplFinish(StringCollection, ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
AlterImplInit(StringCollection, ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
AlterImplWorker() | (Inherited from SqlSmoObject.) |
|
AppendCommaText(StringBuilder, String, Boolean, String) | (Inherited from ScriptNameObjectBase.) |
|
AppendWithCommaText(StringBuilder, String, Boolean) | (Inherited from ScriptNameObjectBase.) |
|
AppendWithOption(StringBuilder, String, String, Boolean) | (Inherited from ScriptNameObjectBase.) |
|
BindDefaultImpl(String, String, Boolean) | (Inherited from SqlSmoObject.) |
|
BindRuleImpl(String, String, Boolean) | (Inherited from SqlSmoObject.) |
|
ChangeMirroringState(MirroringOption) | Changes the mirroring configuration as specified by the options. |
|
CheckAllocations(RepairType) | 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. |
|
CheckCollation(String, ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
CheckIdentityValues() | Verifies the integrity of all identity columns in tables in the database. |
|
CheckObjectDirty() | (Inherited from ScriptNameObjectBase.) |
|
CheckObjectState() | Validates the state of the referenced object. (Inherited from SqlSmoObject.) |
|
CheckObjectState(Boolean) | Validates the state of the referenced object with the option to specify that an exception is thrown if the object is not yet created. (Inherited from SqlSmoObject.) |
|
CheckObjectStateImpl(Boolean) | (Inherited from SqlSmoObject.) |
|
Checkpoint() | Issues a checkpoint. |
|
CheckTables(RepairType) | |
|
CheckTables(RepairType, RepairOptions) | |
|
CheckTables(RepairType, RepairStructure) | |
|
CheckTables(RepairType, RepairOptions, RepairStructure) | |
|
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. |
|
CheckTextCorectness(String, Boolean, Boolean, String[], DdlTextParserHeaderInfo) | (Inherited from ScriptNameObjectBase.) |
|
CheckTextModeSupport() | (Inherited from ScriptNameObjectBase.) |
|
CheckVersion100() | (Inherited from SqlSmoObject.) |
|
CheckVersion80() | Checks the validity of the object on SQL Server 2000. (Inherited from SqlSmoObject.) |
|
CheckVersion80SP3() | Checks the validity of the object on SQL Server 2000 SP3. (Inherited from SqlSmoObject.) |
|
CheckVersion90() | Check the validity of the object on SQL Server 2005. (Inherited from SqlSmoObject.) |
|
CheckVersionBelow90() | (Inherited from SqlSmoObject.) |
|
CleanObject() | Cleans the referenced object. (Inherited from ScriptNameObjectBase.) |
|
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. |
|
CreateImpl() | (Inherited from SqlSmoObject.) |
|
CreateImplFinish(StringCollection, ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
CreateImplInit(StringCollection, ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
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. |
|
DisableAllPlanGuides() | Disables all Plan Guides in a database. |
|
Discover() | (Inherited from SqlSmoObject.) |
|
Drop() | Drops the database. |
|
DropAllPlanGuides() | Drops all Plan Guides in a database. |
|
DropBackupHistory() | Drops the backup history for the database. |
|
DropImpl() | (Inherited from SqlSmoObject.) |
|
DropImplWorker(Urn) | (Inherited from SqlSmoObject.) |
|
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. |
|
EnumScriptImpl(ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
EnumScriptImplWorker(ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
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) | (Inherited from 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. |
|
Finalize() | (Inherited from Object.) |
|
ForceTextModeOnTextBody() | Enforces text mode on the text body. (Inherited from ScriptNameObjectBase.) |
|
FormatSqlVariant(Object) | (Inherited from SqlSmoObject.) |
|
GenerateDataSpaceFileStreamScript(StringBuilder, ScriptingOptions, Boolean) | (Inherited from SqlSmoObject.) |
|
GenerateDataSpaceScript(StringBuilder, ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
GetBindDefaultScript(ScriptingOptions, String, String, Boolean) | (Inherited from SqlSmoObject.) |
|
GetBindRuleScript(ScriptingOptions, String, String, Boolean) | (Inherited from SqlSmoObject.) |
|
GetBoolParameter(StringBuilder, ScriptingOptions, String, String, Int32) | (Inherited from SqlSmoObject.) |
|
GetBoolParameter(StringBuilder, ScriptingOptions, String, String, Int32, Boolean) | (Inherited from SqlSmoObject.) |
|
GetBraketNameForText() | (Inherited from ScriptNameObjectBase.) |
|
GetDateTimeParameter(StringBuilder, ScriptingOptions, String, String, Int32) | (Inherited from SqlSmoObject.) |
|
GetDateTimeParameterAsInt(StringBuilder, ScriptingOptions, String, String, Int32) | (Inherited from SqlSmoObject.) |
|
GetDBName() | Gets the database name that is associated with the object. (Inherited from SqlSmoObject.) |
|
GetEnumParameter(StringBuilder, ScriptingOptions, String, String, Type, Int32) | (Inherited from SqlSmoObject.) |
|
GetFragOptionString(FragmentationOption) | (Inherited from SqlSmoObject.) |
|
GetGuidParameter(StringBuilder, ScriptingOptions, String, String, Int32) | (Inherited from SqlSmoObject.) |
|
GetHashCode() | (Inherited from Object.) |
|
GetIsTextDirty() | Determines whether the text value is consistent with stored value. (Inherited from ScriptNameObjectBase.) |
|
GetParameter(StringBuilder, ScriptingOptions, String, String, Int32) | (Inherited from SqlSmoObject.) |
|
GetParameter(StringBuilder, ScriptingOptions, String, String, Int32, Boolean) | (Inherited from SqlSmoObject.) |
|
GetPropValue(String) | (Inherited from SqlSmoObject.) |
|
GetPropValueOptional(String) | (Inherited from SqlSmoObject.) |
|
GetPropValueOptionalAllowNull(String) | (Inherited from SqlSmoObject.) |
|
GetRealValue(Property, Object) | (Inherited from SqlSmoObject.) |
|
GetScriptIncludeExists(ScriptingOptions, String, Boolean) | (Inherited from ScriptNameObjectBase.) |
|
GetScriptingOptionsForCreate() | (Inherited from SqlSmoObject.) |
|
GetServerName() | Gets the name of the instance of SQL Server with which the object is associated. (Inherited from SqlSmoObject.) |
|
GetServerObject() | (Inherited from SqlSmoObject.) |
|
GetSqlServerVersionName() | Gets the version name of the instance of SQL Server with which the object is associated. (Inherited from SqlSmoObject.) |
|
GetStringParameter(StringBuilder, ScriptingOptions, String, String, Int32) | (Inherited from SqlSmoObject.) |
|
GetStringParameter(StringBuilder, ScriptingOptions, String, String, Int32, Boolean) | (Inherited from SqlSmoObject.) |
|
GetTextBody() | Returns the text body. (Inherited from ScriptNameObjectBase.) |
|
GetTextBody(Boolean) | Returns the text body. (Inherited from ScriptNameObjectBase.) |
|
GetTextForScript(ScriptingOptions, Boolean, String[]) | Gets the text for scripting. (Inherited from ScriptNameObjectBase.) |
|
GetTextForScript(ScriptingOptions, Boolean, String[], Boolean) | (Inherited from ScriptNameObjectBase.) |
|
GetTextHeader(Boolean) | Returns the text header. (Inherited from ScriptNameObjectBase.) |
|
GetTextMode() | Determines whether the script name is using text mode. (Inherited from ScriptNameObjectBase.) |
|
GetTextProperty(String) | (Inherited from ScriptNameObjectBase.) |
|
GetTextProperty(String, ScriptingOptions) | (Inherited from ScriptNameObjectBase.) |
|
GetTimeSpanParameterAsInt(StringBuilder, ScriptingOptions, String, String, Int32) | (Inherited from 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() | (Inherited from Object.) |
|
GetUrnRecursive(StringBuilder) | (Inherited from SqlSmoObject.) |
|
GetUrnRecursive(StringBuilder, UrnIdOption) | (Inherited from SqlSmoObject.) |
|
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. |
|
ImplInitialize(String[], OrderBy[]) | (Inherited from SqlSmoObject.) |
|
Initialize() | Initializes the object and forces the properties be loaded. (Inherited from SqlSmoObject.) |
|
Initialize(Boolean) | Initializes the object and forces the properties be loaded. (Inherited from SqlSmoObject.) |
|
IsMember(String) | Determines whether the specified group or role belongs to the database. |
|
IsObjectDirty() | Determines whether the referenced object is consistent with the stored object. (Inherited from ScriptNameObjectBase.) |
|
IsObjectInitialized() | Verifies whether the object has been initialized. (Inherited from SqlSmoObject.) |
|
IsObjectInSpace() | Verifies whether the object is isolated or connected to the instance of SQL Server. (Inherited from SqlSmoObject.) |
|
IsVersion80SP3() | (Inherited from SqlSmoObject.) |
|
MarkDropped() | (Inherited from SqlSmoObject.) |
|
MarkForDropImpl(Boolean) | (Inherited from SqlSmoObject.) |
|
MemberwiseClone() | (Inherited from Object.) |
|
PostAlter() | (Inherited from SqlSmoObject.) |
|
PostCreate() | (Inherited from SqlSmoObject.) |
|
PostDrop() | (Inherited from 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. (Overrides ScriptNameObjectBase.Refresh().) |
|
RemoveFullTextCatalogs() | Removes full-text catalogs from the database. |
|
Rename(String) | Renames the database. |
|
RenameImpl(String) | This method supports the SMO infrastructure and is not intended to be used directly from your code. (Inherited from NamedSmoObject.) |
|
RenameImplWorker(String) | This method supports the SMO infrastructure and is not intended to be used directly from your code. (Inherited from NamedSmoObject.) |
|
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. |
|
ScriptAlter(StringCollection, ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
ScriptAnsiQI(SqlSmoObject, ScriptingOptions, StringCollection, StringBuilder, Object, Object) | (Inherited from ScriptNameObjectBase.) |
|
ScriptChangeOwner(StringCollection, ScriptingOptions) | This method supports the SMO infrastructure and is not intended to be used directly from your code. (Inherited from NamedSmoObject.) |
|
ScriptCreate(StringCollection, ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
ScriptDdl(StringCollection, ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
ScriptDrop(StringCollection, ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
ScriptImpl() | (Inherited from SqlSmoObject.) |
|
ScriptImpl(ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
ScriptImplWorker(ScriptingOptions) | (Inherited from SqlSmoObject.) |
|
ScriptInformativeHeaders(ScriptingOptions, StringBuilder) | (Inherited from ScriptNameObjectBase.) |
|
ScriptRename(StringCollection, ScriptingOptions, String) | This method supports the SMO infrastructure and is not intended to be used directly from your code. (Inherited from NamedSmoObject.) |
|
SetCollectionTextMode(Boolean, SmoCollectionBase) | Sets the collection text mode. (Inherited from ScriptNameObjectBase.) |
|
SetDefaultFileGroup(String) | Sets the default file group for the database. |
|
SetDefaultFileStreamFileGroup(String) | Sets the default filestream group. |
|
SetDefaultFullTextCatalog(String) | 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(SqlSmoObject) | (Inherited from SqlSmoObject.) |
|
SetSnapshotIsolation(Boolean) | Sets the snapshot isolation level. |
|
SetTextBody(String) | Specifies the text body. (Inherited from ScriptNameObjectBase.) |
|
SetTextHeader(String) | Specifies the text header. (Inherited from ScriptNameObjectBase.) |
|
SetTextMode(Boolean, SmoCollectionBase[]) | Specifies the text mode. (Inherited from ScriptNameObjectBase.) |
|
Shrink(Int32, ShrinkMethod) | Shrinks the database. |
|
SwitchTextMode(Boolean, SmoCollectionBase[]) | Switches the text mode. (Inherited from ScriptNameObjectBase.) |
|
ThrowIfTextIsDirtyForAlter() | (Inherited from ScriptNameObjectBase.) |
|
ToString() | Returns a String that represents the referenced object. (Inherited from SqlSmoObject.) |
|
TouchImpl() | (Inherited from SqlSmoObject.) |
|
TruncateLog() | Truncates the database log. |
|
UnbindDefaultImpl(Boolean) | (Inherited from SqlSmoObject.) |
|
UnbindRuleImpl(Boolean) | (Inherited from SqlSmoObject.) |
|
UpdateIndexStatistics() | Updates index statistics. |
|
Validate(String, Object[]) | (Inherited from SmoObjectBase.) |
|
ValidateAllPlanGuides() | Verifies the validity of the execution plans associated with the database. |
|
ValidateAllPlanGuides(DataTable) |
| Name | Description | |
|---|---|---|
|
IAlienObjectDiscover() | (Inherited from SqlSmoObject.) |
|
IAlienObjectGetParent() | (Inherited from SqlSmoObject.) |
|
IAlienObjectGetProperty(String) | (Inherited from SqlSmoObject.) |
|
ISfcPropertyProviderGetPropertySet() | (Inherited from SqlSmoObject.) |
|
IAlienObjectGetUrn() | (Inherited from SqlSmoObject.) |
|
IAlienObjectResolve(String) | (Inherited from SqlSmoObject.) |
|
IAlienObjectSetProperty(Object, Object) | (Inherited from SqlSmoObject.) |