SQL-DMO Objects and SQL Server Administration
This feature will be removed in the next version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
SQL Distributed Management Objects (SQL-DMO) encapsulates Microsoft SQL Server components, presenting the attributes of the component piece to you as the properties of an object instance. Alter the properties of the instance, or use object methods to automate SQL Server administration.
An instance of SQL Server may be viewed as a collection of components. A component is not simply a database object or a system database record, such as that defining an operator. It can be a more abstract construct, such as the current configuration of an instance of SQL Server. For example:
An instance of SQL Server is installed by a user. The name of the user who installs SQL Server is captured in the registry of the computer on which an instance of SQL Server resides.
The SQL Server Northwind sample database is implemented in physical files in a specific subdirectory of a disk drive. At any given point in time, the usage of space within those physical files can be measured.
The Northwind..Categories table has four columns.
With SQL-DMO, you can use:
The Registryobject RegisteredOwner property as part of an installation of an instance of SQL Server.
The Database object PrimaryFilePath and DataSpaceUsage properties as part of an automated data integrity check system.
The Count property of the Columns collection of a Table object to set the number of pages on a property sheet that presents column definitions.
Essentially, SQL-DMO has three object types:
An object is a stand-alone object that references a single SQL Server component, such as the Tableobject.
A collection is a container object that allows members to be added and removed, such as the Tables collection.
A list is a container object that is fixed in membership, such as the SQLObjectListobject list.
All SQL-DMO objects expose properties, such as Name or Count, identifying instance data. Most expose methods, such as BindToColumn or MSXEnlist, which act upon an instance and usually modify instance data in some fashion. A few objects support events, such as PercentComplete, which provide object state or other data back to the client application.