January 2009 Entries
GUI Automation

There are plenty of frameworks for automating GUI’s but often have a hefty price tag. Well there’s one for free called WASP and it’s for PowerShell. I’ve not used it yet myself but with a really simple set of cmdlet’s such as Select-Window, Select-Control, Send-Click and Send-Keys it looks like a really easy way to build up simple scripts. I could imagine this being fairly useful for developing some simple integration test scripts.

Shrinking a partition in Windows Vista (and possibly other versions?)

Hands up who knew there was an option in Vista’s Computer Management Console to shrink a partition? I didn’t and I discovered it whilst pondering the options for installing a Beta of Windows 7. Mind you, even though I’ve got a complete imaged backup of my laptop with Acronis True Image (a great product in my opinon) I haven’t built up the courage to use this option just yet. The help suggests it relocates files to create the new unallocated space but I’m always a bit nervous mucking about like this – anyone had any experience?

image

Selecting a result set from a stored procedure in SQL Server

Selecting data from a stored procedure in SQL Server is already a documented feature and here’s an example:

insert into #systables exec sp_executesql N'select * from Northwind.sys.tables'

…problem is this example doesn’t run without first creating the temp table and therefore knowing all the column definitions. When I’m running quick queries this isn’t exactly convenient. I’ve seen blogs posts using a linked server but there’s another way :

select * into #systables 
from openrowset(
   'sqlncli', 
   'server=.;trusted_connection=Yes', 
   'sp_executesql N''select * from Northwind.sys.tables'''
)
I wouldn’t necessarily use this as a day-to-day process on a production environment but for administration or scripting installations I think it fits the bill.
Running SQL Server 2005 Reporting Services in IIS7 on Vista

I’ve been trying to navigate to my reporting services on the url http://localhost/reportserver/reportserver2005.asmx but keep getting an internal server error 0x8007007b in the AboMapperCustom-96221 handler :

image

I took a look at the AboMapperCustom-96221 handler (IIS manager –> ReportServer virtual directory –> Feature View –> Handler Mappings) and found that the executable path has a double-backslash :

image

I’ve taken one out and saved changes and allowed the ISAPI extension :

image

An IISReset later and everything seems to be working.

Oh… but don’t forget to run the ReportServer virtual directory in the Classic .Net AppPool. You can do this manually in the IIS manager or use the ‘Reporting Services Configuration Manager’ that comes with SQL Server.

SQL Server Differential Backups and Primary Key choice!

I’ve just set up a weekly full database backup and daily differential daily backups thinking that this would not only speed the daily process up but also reduce the amount of data that’s flying around the servers since our backups are topping 85gigs. However, I was disappointed to notice that the first differential backup containing only a days worth of transactions is already 27gigs even though the quantity of transactions is a lot less.

A quick google and a ‘eureka’ moment seems to have highlighted the problem. A differential backup identifies the data that has changed since the last backup but backs up the entire Extent that the data exists in. (An Extent is 64kb and contains 8 Pages where each Page is 8kb.) That would have been fine except the primary keys we are using are generated as unique guids – which means any data added to a table during the day is randomly, and probably evenly, distributed across the Extents. That’s the ‘eureka’ moment… the differential backup is identifying sparsely updated Extents and so artificially inflating the backup.

Along with the other performance problems we’ve had in the past this is lending more weight to using something along the lines of newsequentialid() function but there’s more details blogged by Jimmy Nilsson which details some alternatives.