Archive for
April, 2009

PowerShell is a great tool that allows DBAs and Developers alike to script, manage and automate SQL Server tasks. Most of the objects and tasks will require SMO (SQL Server Management Objects).

Basic Steps

1. Set Execution Policy

Depending on what you need to do, you may need to set the Execution Policy in your Powershell console. In my case, I will be using it to access SQL Server for administrative purposes, so I will be setting mine to have Unrestricted access to my server. Make sure you review the security guidelines in your organization before you set your environment to Unrestricted

PS>Set-ExecutionPolicy Unrestricted

2. Load assemblies

First, you will need to load SQL Server related assemblies. For SMO, you will usually want to load the following assemblies:

Note that the examples below show how you can manipulate XML nodes – but most operations require singleton values. Ie, the changes must affect one and only one node. Thus in most the examples we specify the index of the node we want to target.

For example:

(/Author/LastName)[1]

which means we are only targetting the first instance of LastName under the Author node. If you need to do a mass update, you may need to use a cursor.

Shereen has posted the “requirements” – and that really sums up to a few words.
Passion and love for what you’re doing.

We do a lot of SharePoint/SQL Server/ASP.NET, but we’re not necessarily looking for the technical skills. Don’t get me wrong, that is very important. You have to be technically adept. However, we also recognize that the technical skill by itself is a hollow measure of what makes a good addition to the team. The passion and the love for what you’re doing will transform into l33t technical skills, just give it some time.

I used to be a PHP/Perl/bash shell/a-little-bit-of-Python developer. When I first applied to a Microsoft-centric company, I had no qualms saying I didn’t code in C# nor ASP.NET, but that I loved learning, and that I loved to program and to do databases. And that wasn’t lip service. As you get more experience, you also realize that although you’d love to learn all cool languages, you pick a few favorite ones and that’s what you master. I still love programming in PHP, but my passions right now are SQL Server (top spot, no question, no competition), SharePoint and C#/ASP.NET. Throw in a whole lotta CSS and a handful of design/creative work

:
100% agree on the list of positive and negative indicators. When I had an opportunity to interview potential engineers, the one question I got the most out of was “If you had enough money that you didn’t have to work, what would you do with your days?”
: