Export (0) Print
Expand All

Database Methods

The Database type exposes the following members.

  Name Description
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. 
Public method ChangeMirroringState Changes the mirroring configuration as specified by the options.
Public method CheckAllocations 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.
Public method CheckIdentityValues Verifies the integrity of all identity columns in tables in the database.
Public method Checkpoint Issues a checkpoint.
Public method CheckTables(RepairType) Tests the integrity of database pages for all tables and indexes defined on the tables of the database.
Public method CheckTables(RepairType, RepairOptions) Tests the integrity of database pages for all tables and indexes defined on the tables of the database.
Public method CheckTables(RepairType, RepairStructure) Tests the integrity of database pages for all tables and indexes defined on the tables of the database.
Public method CheckTables(RepairType, RepairOptions, RepairStructure) Tests the integrity of database pages for all tables and indexes defined on the tables of the database.
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.
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.
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 Discovers a list of type Object. (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.
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.
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 (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 FormatSqlVariant Formats an object as SqlVariant type. (Inherited from SqlSmoObject.)
Protected method GetContextDB Gets the context database that is associated with this object. (Inherited from SqlSmoObject.)
Protected method GetDBName Gets the database name that is associated with the object. (Inherited from SqlSmoObject.)
Public method GetHashCode (Inherited from Object.)
Protected method GetPropValue Gets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected method GetPropValueOptional Gets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected method GetPropValueOptionalAllowNull Gets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected method GetServerObject Gets the server of the SqlSmoObject object. (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.)
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.
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 Determines whether the specified group or role belongs to the database.
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.)
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 Renames the database.
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.
Public method SetDefaultFileGroup Sets the default file group for the database.
Public method SetDefaultFileStreamFileGroup Sets the default filestream group.
Public method SetDefaultFullTextCatalog 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 Sets the parent of the SqlSmoObject to the newParent parameter. (Inherited from SqlSmoObject.)
Public method SetSnapshotIsolation Sets the snapshot isolation level.
Public method Shrink Shrinks the database.
Public method ToString Returns a String that represents the referenced object. (Inherited from SqlSmoObject.)
Public method TruncateLog Truncates the database log.
Public method UpdateIndexStatistics Updates index statistics.
Public method Validate Validates the state of an object. (Inherited from SmoObjectBase.)
Public method ValidateAllPlanGuides() Verifies the validity of the execution plans associated with the database.
Public method ValidateAllPlanGuides(DataTable) Verifies the validity of the execution plans associated with the database and returns validation report.
Top

  Name Description
Explicit interface implemetation Private method IAlienObject.Discover Discovers any dependencies. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetation Private method IAlienObject.GetDomainRoot Returns the root of the domain. (Inherited from SqlSmoObject.)
Explicit interface implemetation Private method IAlienObject.GetParent Gets the parent of this object. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetation Private method IAlienObject.GetPropertyType Gets the type of the specified property. (Inherited from SqlSmoObject.)
Explicit interface implemetation Private method IAlienObject.GetPropertyValue Gets the value of the specified property. (Inherited from SqlSmoObject.)
Explicit interface implemetation Private method IAlienObject.GetUrn Gets the Unified Resource Name (URN) of the object. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetation Private method IAlienObject.Resolve Gets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (Inherited from SqlSmoObject.)
Explicit interface implemetation Private method IAlienObject.SetObjectState Sets the object state to the specified SfcObjectState value. (Inherited from SqlSmoObject.)
Explicit interface implemetation Private method IAlienObject.SetPropertyValue Sets the property value. (Inherited from SqlSmoObject.)
Explicit interface implemetation Private method ISfcPropertyProvider.GetPropertySet Gets the interface reference to the set of properties of this object. (Inherited from SqlSmoObject.)
Top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft