Chapter 9. SQL Server Management Objects (SMO)SQL Server Management Objects (SMO) is a collection of namespaces introduced in SQL Server 2005 for programming all aspects of SQL Server 2005 management. SMO supersedes SQL Server Distributed Management Objects (SQL-DMO). Besides extending SQL-DMO functionality, SMO is easier to use. SMO adds functionality to support new SQL Server 2005 features, in addition to providing all SQL-DMO functionality. SMO uses SQL-DMO terminology where possible to facilitate the migration. However, some DMO properties have been moved or renamed in the transition. For more information, see the Microsoft SQL Server 2005 Books Online section "SMO Mapping to DMO." There is no way to upgrade a SQL-DMO application to SMOthe application must be rewritten. SMO applications can interface with both SMO and SQL-DMO within the same process. SMO is compatible with SQL Server 2000 and SQL Server 7.0. This allows you to use SMO to manage environments with a mix of different SQL Server versions. You cannot use SMO to manage a database with compatibility level 60 (SQL Server version 6.0) or 65 (SQL Server version 6.5). SMO uses the SQL Server data provider (System.Data.SqlClient) to communicate with SQL Server instances. SMO clients must have SQL Server Native Client installed. SQL Server Native Client ships with both SQL Server 2005 and .NET Framework 2.0 and is described in more detail in Chapter 6. SMO clients require one of the following operating systems: Windows NT 4.0 SP5 or later, Windows 2000, Windows XP, or Windows Server 2003. SMO clients also require MDAC 9.0, which ships with SQL Server 2005. SMO assemblies are installed automatically as part of the Client Tools option when installing SQL Server 2005. The default installation directory is C:\Program Files\MicrosoftSQLServer\90\SDK\Assemblies. This chapter introduces SMO, provides an overview of the SMO object, model and demonstrates a simple SMO programming example. The next four chapters explore SMO programming in detail:
![]() |