SMO is a collection of objects that are designed for programming all aspects of managing Microsoft SQL Server. SQL Server Replication Management Objects (RMO) is a collection of objects that encapsulates SQL Server replication management.
SQL Server Management Objects (SMO) are objects designed for programmatic management of Microsoft SQL Server. You can use SMO to build customized SQL Server management applications. Although SQL Server Management Studio is a powerful and extensive application for managing SQL Server, there might be times when you would be better served by an SMO application.
The SMO object model extends and supersedes the Distributed Management Objects (SQL-DMO) object model. Compared to SQL-DMO, SMO increases performance, control, and ease of use. Most SQL-DMO functionality is included in SMO, and there are various new classes that support new features in SQL Server.
Because SMO is compatible with SQL Server 2000, SQL Server 2005, SQL Server 2008 and SQL Server 2008 R2, you can easily manage a multi-version environment. But SMO does not support compatibility level 60, 65 or 70. If you use SMO with a database set to compatibility level 60, 65 or 70, you will not be able to manage the database by using SMO.
The SMO namespace is Microsoft.SqlServer.Management.Smo. SMO is implemented as a Microsoft .NET Framework assembly. This means that the common language runtime from the Microsoft .NET Framework version 2.0 must be installed before using the SMO objects. The SMO assemblies are installed by default into the Global Assembly Cache (GAC) with the SQL Server SDK option. The assemblies are located in C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\.
Sarabpreet Singh Anand
SQL Server 2008 and powershell are strongly integrated. In fact, SQL Server 2008 comes with its own Powershell. Microsoft SQL Server Powershell also known as SQLPS is basically a custom shell built to be used just for SQL Server. SQLPS comes preconfigured with all SQL Server extensions.
Technically speaking SQLPS is a mini-custom-powershell which has multiple Snappins created for SQL Server with its own custom cmdlets (pronounced as command-lets). SQLPS is a great tool to Administer, Monitor or Automate your SQL tasks provided you don’t go beyond SQL, means you can’t add other snappins to SQLPS. This makes it a “CLOSED” shell.
SQLPS uses two Snappins SqlServerCmdletSnapin100 & SqlServerProviderSnapin100. We can use Get-PSSnapins cmdlet to see all loaded\configured snapppins.
If you’ve any exposure to Linux or command prompt, Learning Powershell is very easy. Microsoft did a fabulous job and tried hard to provide the same look and feel + your (few) favorite commands are also compatible in powershell.
Yes, that means if you are coming from Windows background and love to use command prompt you can adopt powershell and start using just like another command prompt with commands like dir, cd and the same is true for Linux experts since powershell supports ls, man etc. Microsoft did this using Aliases Dir, ls are Alias for Get-ChildItem.
Sarabpreet Singh Anand
I am going to start a new blog on “Powershell for SQL Server”.
SQLServerGeeks.com delivered its 3rd SQL Server Day event in Bangalore, the Silicon Valley of India. Sudhir Rawat from Microsoft featured in our events for the 2nd time and delivered a rocking session on Denali Business Intelligence. This was followed by Sarabpreet Singh delivering a session in PowerShell for SQL Server. His Powershell expertise was much appreciated in SSG’s last event in Gurgaon and thus, he carried on with the form. Amit Bansal delivered the 3rd and final session on the day de-mystifying a few things about Locking Architecture in SQL Server. We had a fun-filled day with the 80+ audience really participating so well. Our consistent turn out shows the popularity of our events. We cherish organizing such events and will continue to do so in the future for SQL Server community.
More pics on http://www.FaceBook.com/SQLServerGeeks