Wednesday, July 29, 2009

What is SMO?

Are we wondering what is this SMO...?

Recently one of our team member asked me a question on who we can write a C# code for taking a SQL Server Database Bakup without using "Backup Database" sql command which made me to write this post.

SMO is Sql Server Management Objects providing a set of APIs for managing SQL Server.
In a short note:

"It is a collection of objects that are designed for programming all the aspects of Managing the Microsoft SQL Server"

And also we can say that SMO is a replacement of SQL-DMO(SQL Server Distributed Management Objects). SMO design goal is to mainly improve Scalability and Performance when compared to the SQL-DMO which is available with SQL Server 2000. SMO is relaced with SQL Server 2005 and even it supports SQL Server 2000 as well.

We can use SMO to perform any of the following administrative operations on the SQL Server:

  • Create databases

  • Perform backups

  • Create jobs

  • Configure SQL Server

  • Assign permissions

  • and to perform many other administrative tasks.

    Following are the set of Assemblies available for the programming:


  • Microsoft.SqlServer.Management.NotificationServices

  • Microsoft.SqlServer.Management.Smo

  • Microsoft.SqlServer.Management.Smo.Agent

  • Microsoft.SqlServer.Management.Smo.Broker

  • Microsoft.SqlServer.Management.Smo.Mail

  • Microsoft.SqlServer.Management.Smo.RegisteredServers

  • Microsoft.SqlServer.Management.Smo.Wmi

  • Microsoft.SqlServer.Management.Trace namespaces

  • In the comming post I will explain few set of Objects and how can we write simple program in C# to backup a particular database using SMO APIs.

    No comments: