IV.7.2. Automating Administration with SQL Server Management Objects

SQL Server Management Objects (SMO) can be used to provide management of SQL Server with applications outside of SQL Server. In other words, they're designed to manage and access SQL Server beyond the capabilities of SQL Server Management Studio (SSMS).

SMO objects are built in to the Microsoft .NET Framework. Different name-spaces provide different capabilities.

In past versions of SQL Server, SQL Distributed Management Objects (SQL-DMO) were used to provide some of the functionality of SMO. SQL-DMO used a COM object model and was deprecated in SQL Server 2005. SMO is a .NET assembly and supersedes SQL-DMO in SQL Server 2008.

Some of the common database administration tasks that SMO objects can be used to do include

  • Backups and restores: Many third-party tools use SQL Server Management Objects to simplify common backup and restore tasks.

  • Index maintenance: In addition to traditional index maintenance, you can also manage index table partitioning. With partitioning you can optimize the performance of the database by dividing data from a large index or table so that the data is stored on more than one physical disk.

  • Integrity checks: The Database Base Console Command (DBCC) includes many commands, such as CHECKDB, that can be periodically executed against a database to ensure the logical and physical integrity of ...

Get Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.