JavaScript Editor Ajax toolkit     Ajax tutorials 

Main Page

Previous Page
Next Page

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:

Chapter 10, SQL Server Management Objects (SMO) Instance Classes, Part 1

SMO contains a class hierarchy that matches the SQL Server database hierarchy. This chapter describes the SMO classes used to administer database objects that store and access data, such as tables, indexes, triggers, and stored procedures. It also shows how to use the SMO classes programmatically to administer these objects. In addition, it shows how to subscribe to SMO events and handle exceptions.

Chapter 11, SQL Server Management Objects (SMO) Instance Classes, Part 2

SMO contains classes for administering database objects that do not store or access data, such as data and log files, logins, users, roles, and .NET Framework assemblies. This chapter describes how to use these classes programmatically.

Chapter 12, SQL Server Management Objects (SMO) Utility Classes

SMO utility classes are used to perform tasks that are independent of a SQL Server instance. These classes include scripting, backup and restore, transfer, mail, and tracing classes. This chapter shows how to use these classes programmatically.

Chapter 13, Programming Windows Management Instrumentation (WMI)

WMI can be used to manage SQL Server services, network settings, and server alias settings. This chapter describes the SMO classes that you use to access WMI and shows you how to program these classes.

Previous Page
Next Page

JavaScript Editor Ajax toolkit     Ajax tutorials