Welcome to Matt’s Blog, Please Keep to the Posted Speed Limit

Archive for January, 2008

Aladdin @ Birmingham Hippodrome UK

Posted by 2000mph on January 21, 2008

Went to watch a Christmas pantomime the other day at the Birmingham Hippodrome. First time I have been to one since I was a kid. I knew it would be a show for kids but thought it might be fun anyway. It actually turned out a lot of the humour is aimed at adults while the kids get colourful sets, lots of dancing and singing.

John Barrowman from Doctor Who and Tourchwood was the star and put on a very good performance, and did his best even when his wardrobe let him down a bit and he had to do one scene while holding up his own trousers to prevent them falling down.

However the rest of the cast together made this a great show. The Grumbleweeds, who I had never heard of before, took centre stage doing stand-up comedy to keep the adults entertained and were very funny.

The singing and dancing was as you would expect, not my sort of thing, but it was made more interesting by the dancing girls with very very short skirts and skimpy outfits, which altogether made the dancing much more entertaining.

The best part of the show however was the IMAX style 3D effects. I was hugely impressed  as each time the Genie appeared the back screen was used as a rear projection cinema screen and we all had the 3D glasses. The effects of the 3D were very vivid and caught the attention of the audience very well.

The cross over with Doctor Whoo thanks to Mr Barrowman, was very played to as much as possible but the cameo appearance of the Darleks was great and gave the show a bit of a different edge to it.

Overall a great nights entertainment and I will look forward to seeing another pantomime show again next Christmas.

Posted in Entertainment | Tagged: , , , , | Leave a Comment »

Some boring XML in SQL 2005 code that some might find useful.

Posted by 2000mph on January 3, 2008

OK at work I had to do some work to manipulate some XML stored in SQL 2005 database using SQL scripts. I have never done that before and I’m only basic level SQL programmer. So I did a lot of searching online and found some useful code bits here and there to get the work done. So as a help to other people but mainly as a reminder for me here are a few of the good bits ofSQL code I found.

How to insert new node into some XML stored in SQL database table.

UPDATE tablename SET fieldname.modify('insert if (/ROOT/nodename/[@attributename="attributevalue"]) then <newnodename newattribute="value"> else () as last into /ROOT[1]')

This uses the XML Modify method and contains an if statement that will only insert the new node if an existing node with a certain attribute value exists in the XML. Also you can only insert one new node in this statement, if you try to add multiple nodes in the same statement it will fail.

The if statement in the code above is only checking for one value, what I wanted to do was check for a XML node that had multiple attributes and then insert a new node next to that. To do that took so searching for the correct syntax but it is possible using a if and statement as shown below.

UPDATE tablename SET fieldname.modify('insert if (/ROOT/nodename/[@attributename1="attributevalue1"] and /ROOT/nodename/[@attributename2="attributevalue2"]) then <newnodename newattribute="value"> else () as last into /ROOT[1]')

You can also use and operator inside a XML Query such and not just an if statement as shown above. Below is some code I used to delete a node matching a XML Query that finds a node with multiple attributes with a set value.

UPDATE tablename SET fieldname.modify('delete (/ROOT/nodename/[@attributename1="attributevalue1" and @attributename2="attributevalue2"])')

If the above code isn’t much use check out the sites below where I got the information I needed to put together this code and everything else I needed to know about SQL XML to complete my work.

http://msdn2.microsoft.com/en-us/library/ms175466.aspx

http://technet.microsoft.com/en-us/library/ms345122.aspx

http://www.15seconds.com/issue/050803.htm

Have Fun

MPH.

Posted in Technology | Leave a Comment »