SQL Server Management Objects (SMO)

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 with its own Powershell?

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

Powershell for SQL Server

Hi Guys,

I am going to start a new blog on “Powershell for SQL Server”.


Enjoy Smile

Sarabpreet Singh

SQL Server Webcast on Log Shipping

16-may-2012 log shipping-2

SQL Server Webcast on Bulletproof Backup & Restore Strategy

First Webcast by Sarabpreet Singh on Bulletproof Backup & Restore Strategy

SQL Server Day – Bangalore, 15 October 2011

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 eventsSmile.  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

SQL Server Day – Gurgaon, 30-July-2011

SQLServerGeeks.com delivered a set of rocking sessions on SQL Server Day at Gurgaon on 30th July 2011. We had more than 80 people turning up for the event – all SQL Geeks! Sarabpreet and Amit delivered sessions on PowerShell & Database Testing respectively. The sessions were very well received by the audience.

The highlight of the day was the debate on “Whether Cloud Computing is a hype?” And we were overwhelmed to see the participation of the attendees in the debate.


IMG_1076 IMG_1082 IMG_1083 IMG_1085IMG_1086 IMG_1094IMG_1095 IMG_1096IMG_1097 IMG_1099IMG_1106

SQL Server Day – Delhi, 05 Dec 2010

SQLServerGeeks.com hosted its monthly dose of SQL Server knowledge & learning in Gurgaon on 5th Dec 2010. This was another opportunity to learn maximum from SQL Server Geeks. The event was hosted at the Microsoft premises in Gurgaon.

The event kicked off with Sarabpreet Singh’s session on Implementing Database Snapshots, which was targeted at DBA’s to make them understand how to implement snapshots in their current environment and the usefulness of it. Amit Bansal gave a lecture on Deploying & Securing OLAP databases targeting it towards the BI Developers & IT Pros to let them know more about the OLAP world. The session focused on Deployment and Security techniques. After this session we came to the last session of the day addressed by Rajni Kant Ranjan from Wipro about Data Synchronization using Replication, which actually focuses on the Developer’s audience to show how to replicate the data from database into the applications with proper synchronization.

It was a a fun-filled day for all, besides the event we also had a great photography session. Heartfelt gratitude goes to Rishu Mehra, M. V. Priyank & Col. Dhanaraj Saripalli for coordinating the entire event so smoothly.

260124_159646604101617_110894422310169_397093_1132275_n 250104_159646324101645_110894422310169_397087_3052142_n251756_159646437434967_110894422310169_397091_3036726_n 252443_159646630768281_110894422310169_397094_1667836_n252510_159646464101631_110894422310169_397092_3722153_n 253667_159646737434937_110894422310169_397098_6529424_n253903_159646334101644_110894422310169_397088_8021952_n