Turbocharge your SQL development: get more out of SQL Server Management Studio

When SQL Server 2000 became SQL Server 2005, a huge number of things changed. DTS became SQL Server Integration Services, and as part of the package we saw the likes of Analysis Services and Reporting Services. All these additions to the SQL Server family necesitated a change in the suite of management tools - and that meant the death of Enterprise Manager and SQL Query Analyzer, tools loved by everyone, everywhere. They were combined and rebranded as a single tool: SQL Server Management Studio. DBAs and SQL developers cried out in horror - the new tool was, well, new - it was very different and required a change in working practice. What’s more, there was no choice - if you wanted SQL Server you had to use SSMS - there’s no using Enterprise Manager (although you can use SSMS to manage SQL Server 2000.)

Read more

Quick tip: Use OVER to get row numbers in subsets

Consider the following. You have a set of data. Within the data are multiple subsets that share an identifier. WIthin your main set, you need to number the subsets for each item within it, e.g.,

Data

ID SubsetID Name Lots more columns…
———- ———-
1 ABC Dave
2 DEF Trev
3 DEF Bob
4 DEF Steve
5 HIJ Jim
6 HIJ Bilbo

and you want something like

ID SubsetID SubsetPosition Name Lots more columns…
———- ———-
1 ABC 1 Dave
2 DEF 1 Trev
3 DEF 2 Bob
4 DEF 3 Steve
5 HIJ 1 Jim
6 HIJ 2 Bilbo

Read more

Guide: MOSS 2007 Multiple site collections on Port 80

Requirement: multiple site collections on port 80 on unique URLs in SharePoint 2007, e.g,. http://democlient1, http://someotherdemo
The scenario: you have one development machine which you use for multiple clients. Because of this, you want to host multiple site collections and allow a unique URL for each, without having to specify the port number in the URL. For example, if your machine name is SPDEV then by default your primary web application will respond on http://spdev. But you also want to have http://democlient1, http://someotherdemo, etc. There are a three ways of doing this. The two common ways are 1) assign unique IP addresses to each web application each responding on port 80, but this can be more complicated to setup and manage at the machine level, or 2) Use a non-standard port number for each web application, but this creates uglier URLs, e.g., http://democlient1:18765, http://someotherdemo:18734 etc.

Solution: It’s possible to achieve the requirement.

Read more

Allalinhorn (the easy way)

After our fairly epic 12 hour ascent of the Weismies, we took a rest day. Not surprising really - all four of us were in varying stages of pieces. It meant we had to abandon an ascent of the Lagginhorn - that looked like a full on day. In reality, I felt I might have made it up, but must admit I wasn’t too upset to find myself on a cable car going down the valley from the Weismies Hut. We were back in Saas Almagell by mid morning.

Read more

The Weissmies Traverse

5am start. 40 other people all doing the same. Force yourself out of a warmish bed to a very cold Alpine hut. Bag was packed the evening before so it’s just extra clothes on then downstairs for breakfast. Cereal and milk, bread and jam and some hot but tasteless black water, or coffee, as they were calling it. Sense of trepidation about what lay ahead. On paper it was a 1,300m ascent to 4,020m, but this was via rock ridge and a narrow snow ridge. Surely it couldn’t be too bad?

Read more

Saas Valley 2010

Holidays this year were a week in the Saas Valley in the Swiss Alps in Switzerland. It was my Dad’s idea, and when he suggested I join him and family friend Brian and mountain leader Mike for some climbing 4000m mountains, I thought why not? Bonding time with the old man, how bad could it be? Well, I made the mistake of checking out some video before going and was soon wondering what I’d let myself in for. I then found the blog of a group who had just got back from a trip doing moreorless the same thing as we were planning, I don’t think it put me at ease in the slightest. Don’t get me wrong, I’m probably above average fitness and fear levels, but still, photos of the Weismies traverse certainly had me wondering about my ability. After scavenging as much gear as possible, as well as a shiny pair of new Scarpa Cumbre boots and some Grivel 12 crampons, I thought I was all set. The one thing that had been reiterated to me over and over again - travel light! Whatever’s in your bag, you have to carry, so if you don’t need it, don’t take it. So with literally two pairs of pants, two pairs of socks, some emergency food and zero luxuries (i.e., no iPad) we were set to leave Guernsey for Geneva.

Read more

VW Polo GTi 6n2 electric window switches refurbishment

The electric window switches on my 2001 6n2 VW Polo GTi recently had always been a bit hit and miss - they’d work about 75% of the time, then one day, they just stopped working completely. It’s a common problem on these cars - and actually, I’d wager it doesn’t just afflict Polos, probably any of the Golf/Seats/Skodas etc. that use the similar components. The problem in my instance was not electrical (well not really) - that is the windows and the switches themselves were fine, the problem was that there was a build-up of “green corrosion” on the electrical contacts - a side effect of the oxidation of the soft metals used in the contacts. The end result is that the green sucks away the power running through the switch, so enough doesn’t get through the circuit, and hence the switches don’t work.

Read more

Troubleshooting BDC Associations and Related Data List Web part

I’ve been working with the BDC and a proprietary CRM system to bring data about sales history into SharePoint. I’ve been using the basic BDC tool - Business Data Catalog Definition Editor - that is bundled with the SharePoint SDK. It’s very basic, and there are one or two commercial products out there, but it just about does enough, and is free, after all. It enables you to define the entities, relationships and methods, and test them, within the tool. The error reporting is moderate - you’re informed about the major issues, but, some errors only appear when you’ve imported the ADF and are actually working within the SharePoint environment.

Read more

Set SharePoint BDC field value programmatically in Visual Studio workflow

The Business Data Catalog (BDC) in SharePoint is a superb way of hooking up virtually any disparate system to SharePoint 2007. By defining the connection in to the system, you can expose any part of the system to SharePoint, and harness some of SharePoint’s real power - for example, its powerful search capabilities. Once you’ve created your connection (your Line Of Business [LOB] system), you can attach BDC columns to any list (e.g., document library) and you can, for example, have a document with a reference to your other system, so that you can permanently associate extra data to your document, without having to reproduce the information in SharePoint and create unnecessary duplication.

Using the BDC is beyond the scope of this post, but I’d like to cover an issue that I recently encountered when trying to work with the BDC and a document library. I had a fairly simple Visual Studio 2008 workflow that ran when a new item was created in the document library.

Read more

Simplified SharePoint solution deployment

Any SharePoint developer will have to work with SharePoint Features at some point. Features are a great way to extend the core functionality of MOSS - in Web 2.0 speak, think of them as “plugins” and you’ll understand why they’re useful. Features can take a variety of forms - workflows being one of them. I’ve discussed in the past the usefulness of SharePoint Designer for workflow creation and eventually you’ll need to move to Visual Studio. Features (and workflows) can be designed directly in Visual Studio - support was added in 2005, but its support is further extended in 2008 - Visual Studio will generate all the required bits you need to actually get the workflow ready to be deployed to your SharePoint environment and gives you the all important debugging and code step through stuff. There’s a nice guide to the basics of workflow and Visual Studio.

Read more