Archive for November 16th, 2007

SQL PowerShell details revealed

Kirk, Richard, and Jeffrey have already blogged that SQL 2008 is (unless this gets canceled) going to have PowerShell support built in. Today on the last day of the IT Forum we learned the details. And frankly were not impressed. At least Richard and I – who were sitting on the front row and were ranting so much that Bob Beauchemin stopped giving us a word at some point (just kidding, Bob had this talk kind of imposed on him and did his job quite well despite not really being a PowerShell guy.)

Anyways, here are the details:

PowerShell is likely to debut in SQL 2008 in CTP 6 in February 2008.

What they will ship is a provider which will allow you to browse SQL databases and tables as a file system.

The provider will not give access to the actual data in the databases: only to the structure (down to columns) and configuration settings

You are not able to create items (tables, columns, rows) or copy them.

Changing any settings is very unintuitive because they have to be done via properties of objects. So you have to first cd into the database/table/column, and then do something like dir | foreach-object { $_.Method (parameter1, parameter2, etc.) } – this is not only lengthy but also not quite in line with PowerShell discoverability as you get no help or tab-completion for such calls.

A much better approach would have been a set of cmdlets but this was not the way selected by the team. At least not for now.

For now, there will be just 4 cmdlets with quite auxiliary tasks:

  • Run-Sqlcmd
  • Decode-SqlName
  • Encode-SqlName
  • Convert-UrnToPath

I hope that post 2008 RTM, SQL team will revise their PowerShell design and make it fit better into PowerShell principles and provide better ways of managing SQL databases and accessing the data. Until then, the use will probably be limited to just browsing the databases, and for most tasks .NET classes being called from PowerShell syntax (like in this pack from PowerGUI library).

Tags: ,


My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

November 2007
M T W T F S S
 1234
567891011
12131415161718
19202122232425
2627282930  

%d bloggers like this: