I’ve been checking whether or not service packs have been applied on SQL Server Installations. I keep forgetting the script that I run to check this,  and having to look it up.

So, here it is:

SELECT SERVERPROPERTY(‘productversion’), SERVERPROPERTY (‘productlevel’), SERVERPROPERTY (‘edition’)

This seems to work in SQL 2000, 2005 and 2008

Taken from this Microsoft link:

http://support.microsoft.com/kb/321185

You could also try

SELECT @@version

Which will give you everything (and more) in a single string:

Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)   Feb  9 2007 22:47:07   Copyright (c) 1988-2005 Microsoft Corporation  Developer Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

Go nuts! Here is a free EBook on Defensive SQL Server Programming from Red Gate

Defensive Database Programming with SQL Server

Alex Kuznetsov

ISBN: 978-1-906434-44-1

This leads us to another interesting article:

The Curse and Blessings of Dynamic SQL

, ,

I thought it worthwhile mentioning a few words about my old JamesWiseman.com site.
Digital IXUS 300
In 2001 I took a 5 month sabbatical from work and went travelling. The destinations were New Zealand, Autralia, Singapore and Fiji, and its fair to say that I had a ball! Most people did not have a digital camera, but I went armed with my trusty 2001 Digital IXUS 300.

With this, I was able to take literally thousands of pictures. The law of averages won through, and some turned out spectacularly. When I got back, I sifted through the pictures and picked out the best.

Meanwhile, the previous owner of the domain name, a fellow in America who went by the name of Jimmy Wiseman, had seemingly lost interest, or had accidentally let this domain expire. I had been watching this for some time, and was in there like a shark. I snapped it up for three years as soon as I could.

So my first attempt at the site was a series of static HTML pages (generated by a program I had written, mind you). It was a load of pictures for people to look at, so I added a bit of navigation, and some text, and suddenly Google indexed it. Hooray!

PHPBy this time I had moved jobs and was starting to write ASP. At which point it occurred to me that I could do the site a whole lot better if I did it in something similar. PHP was available on my website host, so off I went. PHP.NET was a wonderful place to go for all the information I needed.

I then started writing JavaScript, and that fitted in quite nicely, thank you very much. I had spiffy whizzing menus, and I was learning lots.

Tower Bridge Then it became hassle to add new pictures. It was a lengthy process, so I set about writing my own interface to do this. I could upload pictures, set text, update my database, add pages, all at the click of a button. Before long I had a very crude content management system.

Then a few people wanted to buy my pictures. I had them published in magazines, and everything! Google accepted my site a valid publisher, and money started rolling in from their Adsense program.

I hacked around, bolted things on, extended, changed and fixed. I had a look at the code recently, and my word, its messy! But, that site taught me so much about web development, SEO, image management, image editing, watermarking and photo stitching. Even though I would do it all very differently today, I am still quite proud of it.

I recently found a web archive of the site, complete with the aforementioned previous tennant, Jamie Wiseman

The old site is still hosted here, but by default this blog is now the root page of the site.

, , ,

I stumbled across this the other day. The Internet Archive project may have stored what your site looked like 5 years ago on the WayBack Machine

Personally, i think this is an astounding project. I got to see the very first incantation of this site and a site that I ran at university that got wiped from the servers when I left WAY BACK IN 1999! For anyone interested, they’ve even got a picture of me from way-back-when.

WayBack MachineMoreover, some of the links from these pages, some long since dead, are also archived as well. My goodness! It’s a trip down memory lane. Sorry, back in a minute…

…A colleague commented on this. “So, it doesn’t matter what you delete from a webpage, as there could always be a record of it somewhere!”

Google and Microsoft go back to 1996, which seems to be as far back as it goes. Interestingly enough, the first web page in the world only goes back as far as 1997.

Fortunately, Internet Archive give you a way of removing the site, however what my colleague said could ring true. Who knows what else there is out there? And, not just stuff that is online, I’m talking about results of crawls that are sitting offline somewhere; possibly on some government server.

I got all this after looking up the site on strategicfirst.com which also estimates the value of the site. I would be interested in seeing that algorithm, especially as the value changes if you resubmit it.

Incidentally, this domain is quoted as being worth $5000. Any takers?

By the way, Google was $220 Million last time I checked. I’m pretty sure they wouldn’t sell even for 1000 times that.

,

Last year I held a jQuery course, and was fortunate enough to recieve very generous praise from my peers, including the following:

What parts of the training did you feel were of most value?Biscuits
The overview of the key paragdim interjected with real examples expedited learning

What parts of the training did you feel were of least value?
The lack of biscuits

What, if anything, would you change about the course?
Provide biscuits

Any further comments?
More biscuits please

So there we have it. Biscuits, cakes, muffins, coffees and teas. Bribing your audience can always help!

, ,

It occurred to me the other day how often I was needing to perform a ‘Paste Special’ operation to ensure the format of the pasted text was not carried across. I did a little straw-poll and found that it was most of the time.

I’d select ‘Home’ in the ribbon, drop down ‘Paste’ and select ‘Paste Special’. Latterly I found out about the ctl-alt-v shortcut, but I still found it annoying that having to do this.

So I searched around, and found exactly what I wanted on Roel van Lisdonk’s Blog. Roel assures us that this works in Microsoft Word 2010; I’ve tried it with 2007 and it also works.

We can configure Word to ignore formatting by changing some options. Start by clicking on the Office Button:

Word Main Menu

Then click the ‘Word Options’ button. When the dialog loads, click on ‘Advanced’ in the left pane:

Word Advanced Options.

The section you want is ‘Cut, copy and paste’

I changed the option ‘Pasting from other programs’ to ‘Keep Text Only’, but you are free to play around with these as you see fit.

,

Back in September 2008 Microsoft announced that it would be shipping jQuery with Visual Studio going forward. This was pretty momentous news at the time, as noted in the jQuery Blog.

True to its word, Microsoft Shipped jQuery with Visual Studio 2010, and it is now included by default in your ASP.NET web projects.

Further to this, Microsoft is now actively contributing to the jQuery project itself.

All this really underlines the emerging dominance of jQuery and gives extra reason for this to be JavaScript library of choice for anyone thinking of adopting a JavaScript framework.

,

I once answered a Question on StackOverflow regarding surnames and regular expressions. I thought this might be worthy of a note here as well.

The questioner wanted to how to write a regular to transform surnames with irregular capitalisations. I.e. names like

  • MckIntosh
  • MacDonald
  • O’Reily

Quite simply this is not possible as there is no reliable rule that holds 100% of the time.

Consider the following names:

  • Mrs Macey
  • Mr Opal
  • Mr Macdonald

They are all correct. Even Mr Macdonald who doesn’t capitalise his ‘D’s. Our regex would churn out:

  • Mrs MacEy
  • Mr O’pal
  • Mr MacDonald

Bad regex!

We have to be careful when dealing with surnames – these could be our customers after all. And there is little that is more insulting than having your own name being churned up and spat out by some half-baked regex. Especially as this may be done by several such half-based regexes at different companies. You may feel like you want to change your name just so they get it right!

It’s as bad a name mispronunciation. I feel for all the people named Cockburn – (pronounced ‘Coeburn’), or McLeod – (‘McCloud’).

Unfortunately, this is all too common. Some systems are programmed only to store uppercase characters, in which case you are scuppered, and you do have to rely on some magical but flawed algorithm.

Others seek to perform some sort of user-input validation or correction. In any such case, the validation system should allow the user to input what they intended and not tell them how to think.

And always make it really really easy in your systems and processes to make minor corrections to a surname. This is a human being after all!

I still get letters from Scottish Gas addressed to Mr G Wiseman. And yet, they know my first name is James. I’ve tried to change it but just go through numerous levels of call-centre, and then get told that I need to provide it in writing. and email is not good enough. Sigh!

,