Thursday, 29 September 2011

SQL Bits Training Day

By David Postlethwaite

Just spent a day with Allen White, a SQL MVP from Ohio, USA learning about automating and managing SQL Server using PowerShell

PowerShell is ubiquitous in Windows now and can be used to view and manage any part of the Windows systems, it uses the .NET framework which, for me who has written plenty of c#,  made it much easier to understand. One of the things I liked about PowerShell was the way that objects like the registry and SQL Server can be browsed just like a disk drive.

The real winner, not just for PowerShell but for .NET as well, is SQL Server Management Objects or SMO, a whole class of functions that can be used to interrogate SQL Server. I hadn’t come across this before but I could see so many ways that I could use it for retrieving information and managing SQL Server. An example was “how would you find all varchar fields in all databases in several instances and change them to varchar(max). A nightmare with t-sql but with SMO quite easy.

We also saw example scripts for retrieving performance data into a database.

For support and diagnostics of your own systems its definitely the way to go , much more flexible than t-sql and much better for quick ad-hoc queries than trying to use .NET. And there are loads of example scripts on-line.

Can’t wait to give it a go back in the office

Wednesday, 28 September 2011

David’s SQLBITS Day 1–The Travel Day

Just had a pleasurable 5 hours watching the Autumn countryside go by on a glorious sunny day (in fact its warmer at the end of September than it was for most of July and August).

Where am I heading you ask? Liverpool the home of the Beatles, the Mersey Ferry and Nerris Hughes. I’m here for SQLBits, a 3 day biannual conference held in the UK for everything SQL Server.

This is my 2nd time to SQLBits, the last being in March at the Grand Hotel in Brighton.

Thursday is a training day where one studies a particular topic in depth. Friday  has a choice of 30 different sessions. Saturday has another 30 sessions but this day is free to attendees.

On Thursday I’m looking forward to getting to grips with PowerShell. As well as being a SQL DBA I also write a lot of ASP.NET. I’ve written quite a comprehensive web site to audit and troubleshoot my SQL Server estate but I’ve wanted to learn PowerShell to allow me to run quick checks and automation commands just like I used to do with DOS in days gone by.

I’ve hear a lot about how useful PowerShell  and I became enthused at last year’s Tech-Ed in Berlin where I went to a talk by one of the people responsible for its creation. I could see the potential for not just helping the DBA for supporting all parts of Windows.

But, as often the case, finding time to put these things into action isn’t easy. You come back enthused by these events but the daily grind of work stops you from having to time to experiment and take advantage of what you’ve learned and soon its forgotten.

I am determined this year to use what I learn and give myself time to re-watch the recordings of the talks that I go to.

I’ll let you know tomorrow how I got on.

Featured post

Creating a Linked Server to an Azure SQL Database

Why would you create a Linked Server to an Azure SQL Database? If you work in a hybrid environment with some databases stored on your on ...