Click to Rate and Give Feedback
Other versions are also available for the following:
Microsoft.SqlServer.Management.Smo Namespace

The Microsoft.SqlServer.Management.Smo namespace contains classes that represent the core SMO objects. These include instances, utility classes, enumerations, event handler types, and exception types.

The Microsoft.SqlServer.Management.Smo namespace contains the instance object classes that represent SQL Server Database Engine objects and some utility classes that represent specific tasks, such as scripting. When a connection to the instance of SQL Server has been established by using a Server object variable, objects on the instance of SQL Server can be accessed by using the SMO instance objects. For example, you can use the Database object to access databases on the connected instance of SQL Server. All the instance classes are related to the Server class in the object hierarchy. Utility classes exist outside of the Server class object hierarchy and represent specific tasks, such as backup or scripting.

The Microsoft.SqlServer.Management.Smo namespace resides in the Microsoft.SqlServer.Smo.dll file. Additionally, some of the enumeration classes are in the Microsoft.SqlServer.SqlEnum.dll and Microsoft.SqlServer.SmoEnum.dll assembly files. You will have to import all three files to access the classes in the Microsoft.SqlServer.Management.Smo namespace.

By using the Microsoft.SqlServer.Management.Smo namespace, you can do the following:

  • Connect to an instance of SQL Server.

  • View and modify SQL Server settings and configuration options.

  • View and modify SQL Server engine objects.

  • Perform DDL (data definition language) tasks on an instance of SQL Server.

  • Script databases dependencies.

  • Back up and restore databases.

  • Transfer database schemas and data.

ClassDescription
AbstractCollectionBaseThe AbstractCollectionBase object is a base class object that is used in the construction of collection objects.
ApplicationRoleThe ApplicationRole object represents a security role that is used to set access privileges from an application regardless of the user's permissions.
ApplicationRoleCollectionThe ApplicationRoleCollectionclass represents a collection of ApplicationRole objects that represent all the application roles on the referenced database.
ApplicationRoleEventsThe ApplicationRoleEvents object represents the settings required for Microsoft SQL Server application role event notification.
ArrayListCollectionBaseThe ArrayListCollectionBase object represents a base class that is used in the construction of collections that are based on array lists.
AsymmetricKeyThe AsymmetricKey object represents a SQL Server asymmetric key.
AsymmetricKeyCollectionThe AsymmetricKeyCollection class represents a collection of AsymmetricKey objects that represent all the asymmetric keys on the referenced database.
AsyncStatusThe AsyncStatus object represents the status of an asynchronous process.
AuditThe Audit object represents a SQL Server audit log.
AuditCollectionThe AuditCollection class represents a collection of Audit objects that represent all the audits on the instance of SQL Server.
AuditExtenderAdds methods and properties to the Audit object.This class is not CLS-compliant.
AuditSpecificationThe Column object represents a SQL Server column.
BackupThe Backup object provides programmatic access to Microsoft SQL Server backup operations.
BackupDeviceThe BackupDevice object provides programmatic access to SQL Server backup devices.
BackupDeviceCollectionThe BackupDeviceCollection class represents a collection of BackupDevice objects that represent all the backup devices on an instance of SQL Server.
BackupDeviceItemThe BackupDeviceItem object provides programmatic access to named SQL Server backup devices.
BackupDeviceListThe BackupDeviceList object provides programmatic access to a list backup devices. This class is not CLS-compliant.
BackupRestoreBaseThe BackupRestoreBase class is a base class that represents functionality that is common to both backup and restore operations.
CertificateThe Certificate object represents a SQL Server certificate.
CertificateCollectionThe CertificateCollection class represents a collection of Certificate objects that represent all the certificates on an instance of SQL Server.
CertificateEventsThe CertificateEvents object represents the settings that are required for SQL ServerCertificate event notification.
CheckThe Check object represents a Microsoft SQL Server check constraint.
CheckCollectionThe CheckCollection class represents a collection of Check objects that represent all the check constraints defined on the parent object.
CollectionNotAvailableExceptionThe CollectionNotAvailableException class is an exception that is raised when an attempt is made to retrieve a collection that is not available.
ColumnThe Column object represents a SQL Server column.
ColumnCollectionThe ColumnCollection class represents a collection of Column objects that represent all the columns defined on a table.
ConfigPropertyThe ConfigProperty object contains information pertaining to a Microsoft SQL Server configuration option, such as maximum, minimum, current, and new values.
ConfigPropertyCollectionThe ConfigPropertyCollection class represents a collection of ConfigProperty objects that represent all the configuration properties defined on the instance of SQL Server.
ConfigurationThe Configuration class contains the configuration information for the instance of SQL Server.
ConfigurationBaseThe ConfigurationBase class is a base class that represents configuration information for the instance of SQL Server.
CredentialThe Credential object represents a Microsoft SQL Server credential.
CredentialCollectionThe CredentialCollection class represents a collection of Credential objects that represent all the credentials defined on the instance of Microsoft SQL Server.
CryptographicProviderThe CryptographicProvider object represents a SQL Server cryptographic provider.
CryptographicProviderCollectionA collection of type CryptographicProviderCollection that represents a collection of CryptographicProviderr objects.
DatabaseThe Database object represents a SQL Server database.
DatabaseActiveDirectoryThe DatabaseActiveDirectory object provides programmatic access to the Active Directory settings for a database.
DatabaseAdapterDatabase Adapter type to be used as a management facet.
DatabaseAdapterBaseDatabase adapter base.
DatabaseAuditSpecificationThe DatabaseAuditSpecification object represents an auditable event on the database.
DatabaseAuditSpecificationCollectionThe DatabaseAuditSpecificationCollection class represents a collection of DatabaseAuditSpecification objects that represent all the audit specifications defined on the database.
DatabaseAuditSpecificationExtenderAdds methods and properties to the DatabaseAuditSpecification object.This class is not CLS-compliant.
DatabaseCollectionThe DatabaseCollection class represents a collection of Database objects that represent all the databases defined on the instance of SQL Server.
DatabaseDdlTriggerThe DatabaseDdlTrigger object represents a SQL Server database data definition language (DDL) trigger.
DatabaseDdlTriggerCollectionThe DatabaseDdlTriggerCollection class represents a collection of DatabaseDdlTrigger objects that represent all the database data definition language (DDL) triggers defined on a table.
DatabaseDdlTriggerEventThe DatabaseDdlTriggerEvent object represents the SQL Server database DDL trigger events that can be included in a database DDL trigger event set.
DatabaseDdlTriggerEventSetThe DatabaseDdlTriggerEventSet object represents a set of SQL Server database data definition language (DDL) trigger events.
DatabaseEncryptionKeyCreates a database encryption key.
DatabaseEncryptionKeyExtenderExtends the database encryption key class.This class is not CLS-compliant.
DatabaseEventThe DatabaseEvent object represents the SQL Server database events that can be included in a database event set.
DatabaseEventArgsThe DatabaseEventArgs object represents the arguments passed by the event raised by the database.
DatabaseEventsThe DatabaseEvents object represents the settings required for Microsoft SQL Server database event notification.
DatabaseEventSetThe DatabaseEventSet object represents a SQL Server set of database events.
DatabaseFileThe DatabaseFile object is a base class used in the construction of DataFile objects and LogFile objects.
DatabaseFileMappingsDictionaryThis class, which is inherited from Dictionary, maps database file paths from the source server to the corresponding target server location that the user specifies.
DatabaseMaintenanceAdapterThe Database Maintenance facet has logical properties. It inherits from the DatabaseAdapter class.
DatabaseMappingThe DatabaseMapping object represents a SQL Server database mapping.
DatabaseMirroringPayloadThe DatabaseMirroringPayload object represents database mirroring payload settings.
DatabaseOptionsThe DatabaseOptions object represents SQL Server database options.
DatabasePerformanceAdapterThe Database Performance facet implements logical properties relevant to database performance management.
DatabasePermissionThe DatabasePermission object represents a SQL Server database permission. The database permission can be added to a database permission set, and then granted, revoked, or denied to a user.
DatabasePermissionInfoThe DatabasePermissionInfo object represents information about a SQL Server database permission.
DatabasePermissionSetThe DatabasePermissionSet object represents a SQL Server set of database permissions.
DatabaseRoleThe DatabaseRole object represents a SQL Server database security role.
DatabaseRoleCollectionThe DatabaseRoleCollection class represents a collection of DatabaseRole objects that represent all the database roles defined on the parent database.
DatabaseSecurityAdapterIncludes properties and methods that are used to expose the Database Security facet.
DatabaseSnapshotExtenderAdds methods and properties to the DatabaseSnapshot object.This class is not CLS-compliant.
DataFileThe DataFile object represents a Microsoft SQL Server data file.
DataFileCollectionThe DataFileCollection class represents a collection of DataFile objects that represent all the data files defined on the parent object.
DataTypeThe DataType object represents a SQL Server data type.
DdlTriggerBaseThe DdlTriggerBase is a base class that is inherited by the DatabaseDdlTrigger object. This represents a SQL Server database data definition language (DDL) trigger.
DefaultThe Default object represents a Microsoft SQL Server default.
DefaultCollectionThe DefaultCollection class represents a collection of Default objects.
DefaultConstraintThe DefaultConstraint object represents a SQL Server default constraint.
DefaultRuleBaseThe DefaultRuleBase class is a base class that is inherited by the Rule class and the Default class.
DependencyCollectionThe DependencyCollection class represents a collection of Dependency objects that are used to derive the node classes in SMO scripting operations.
DependencyCollectionNodeThe DependencyCollectionNode class represents a node in the dependency collection that is derived during scripting operations.
DependencyNodeThe DependencyNode class represents a node that is defined by a URN address.
DependencyTreeThe DependencyTree object represents a tree structure that contains SQL Server objects and their hierarchical relationships to each other.
DependencyTreeNodeThe DependencyTreeNode class represents the child and sibling SQL Server objects within a DependencyTree object hierarchy.
DependencyWalkerThe DependencyWalker object is a tool to perform scripting operations that involve dependencies such as identifying dependent relationships. The tool and converts this output to a list.
EndpointThe Endpoint class represents an endpoint service that can listen natively for requests.
EndpointCollectionThe EndpointCollection class represents a collection of Endpoint objects that represent all the HTTP endpoints.
EndpointPayloadThe EndpointPayload object represents an endpoint payload.
EndpointProtocolThe EndpointProtocol object represents an HTTP endpoint protocol.
EventPropertyThe EventProperty class represents a property of an event.
EventPropertyCollectionThe EventPropertyCollection object represents the properties of event objects.
EventSetBaseThe EventSetBase class is a base class that is used to derive the event set objects.
ExtendedPropertyThe ExtendedProperty object represents the extended properties that are defined for any object that has an ExtendedProperties collection property.
ExtendedPropertyCollectionThe ExtendedPropertyCollection class represents a collection of ExtendedPropertyCollectionobjects that represent all the extended properties.
ExtendedStoredProcedureThe ExtendedStoredProcedure object represents an extended stored procedure on the instance of Microsoft SQL Server.
ExtendedStoredProcedureCollectionThe ExtendedStoredProcedureCollection class represents a collection of ExtendedStoredProcedure objects that represent all the extended stored procedures defined on the parent database.
FailedOperationExceptionThe FailedOperationException class represents the exception raised when an operation fails.
FileGroupThe FileGroup object represents a SQL Server file group.
FileGroupCollectionThe FileGroupCollection class represents a collection of FileGroup objects that represent all the filegroups defined on the parent database.
ForeignKeyThe ForeignKey object represents a SQL Server foreign key.
ForeignKeyCollectionThe ForeignKeyCollection class represents a collection of ForeignKey objects that represent all the foreign keys defined on the parent object.
ForeignKeyColumnThe ForeignKeyColumn object represents a SQL Server foreign key column.
ForeignKeyColumnCollectionThe ForeignKeyColumnCollection class represents a collection of ForeignKeyColumn objects that represent all the foreign key columns defined on the parent object.
FrequencyPairThe FrequencyPair object is a utility that measures frequency by storing count and duration information.
FullTextCatalogThe FullTextCatalog object represents a Microsoft Search full-text catalog.
FullTextCatalogCollectionThe FullTextCatalogCollection class represents a collection of FullTextCatalog objects that represent all the full-text catalogs defined on the parent object.
FullTextIndexThe FullTextIndex object represents a Microsoft Search full-text index.
FullTextIndexColumnThe FullTextIndexColumn object represents a Microsoft Search full-text index column.
FullTextIndexColumnCollectionThe FullTextIndexColumnCollection class represents a collection of FullTextIndexColumn objects that represent all the full-text index columns defined on the parent object.
FullTextServiceThe FullTextService object allows programmatic access to the Microsoft Search full-text settings.
FullTextStopListThe FullTextStopList object represents a full-text stop list.
FullTextStopListCollectionThe FullTextStopListCollection class represents a collection of FullTextStopList objects that represent all the full-text stop lists that are defined on the parent database.
HttpProtocolThe HttpProtocol object represents an HTTP protocol on an instance of Microsoft SQL Server.
IndexThe Index object represents a SQL Server index.
IndexCollectionThe IndexCollection class represents a collection of Index objects that represent all the indexes defined on the instance of SQL Server.
IndexedColumnThe IndexedColumn object represents a SQL Server column that is participating in an index.
IndexedColumnCollectionThe IndexedColumnCollection class represents a collection of IndexedColumn objects that represent all the indexed columns defined on the instance of SQL Server.
IndexEventsThe IndexEvents object represents the settings that are required for SQL Server index event notification.
InformationThe Information class contains nonconfigurable information about the instance of SQL Server. These include system information and options that are set during Setup, such as the collation.
InternalSmoErrorExceptionThe InternalSmoErrorException class represents the exception raised when an error occurs during the internal phase of a SMO operation.
InvalidSmoOperationExceptionThe InvalidSmoOperationException class represents the exception raised when an SMO operation is not valid.
InvalidVersionSmoOperationExceptionThe InvalidVersionSmoOperationException class represents the exception raised when the version is not valid on an SMO operation.
JobScheduleCollectionBaseThe JobScheduleCollectionBase class represents a base class that is used in the construction of the JobScheduleCollection class.
LanguageA Language object represents a language supported by SQL Server. The SQL Server language determines the date and time formats and the language in which the system messages are displayed.
LanguageCollectionThe LanguageCollection class represents a collection of Language objects that represent all the languages which are defined on the instance of SQL Server.
LinkedServerA LinkedServer object represents a database system other than SQL Server and is linked to the current instance of SQL Server by using an OLE DB driver.
LinkedServerCollectionThe LinkedServerCollection class represents a collection of LinkedServer objects that represent all the linked servers registered on the instance of SQL Server.
LinkedServerLoginThe LinkedServerLogin object represents a SQL Server logon account that has permission to connect to the linked server.
LinkedServerLoginCollectionThe LinkedServerLoginCollection class represents a collection of LinkedServerLogin objects that represent all the linked server logins defined on the linked server.
LogFileThe LogFile object represents a SQL Server log file.
LogFileCollectionThe LogFileCollection class represents a collection of LogFile objects that represent all the log files defined on the instance of Microsoft SQL Server.
LoginThe Login object represents a SQL Server login account that has been granted access to the instance of SQL Server through Windows Authentication or SQL Server Authentication.
LoginCollectionThe LoginCollection class represents a collection of Login objects that represent all the login accounts defined on the instance of SQL Server.
LoginEventsThe LoginEvents object represents the settings required for SQL Server login event notification.
MasterKeyThe MasterKey object represents a SQL Server database master key.
MessageCollectionBaseThe MessageCollectionBase class is a base class that is used in the construction of message collection classes.