web 2.0

XBox 360 Fun

I had been holding off buying an XBox 360 since I'm really not that much of a gamer and when I do play I totally suck anyway. For us non-gamer types, the XBox Live Marketplace sounds interesting since it offers high-definition movies, but alas as a Canadian I am deprived of such a useful feature (though Microsoft has said this will be available in Canada by the end of 2007). However, with last week's release of Halo 3, I really had no choice but to break down and get myself one. Halo is just about the only video game I've played in, oh, ten years so once again I bought an expensive piece of hardware just so I could play this damn intoxicating game.

I decided to get an XBox Elite primary for the larger hard drive, since outside of Halo I expect my only primary use of the machine will be for buying and watching high-def content. I ordered my machine through Dell Canada and got a deal where Halo 3 was included for free (I also got $30 off an extra controller with the play and charge kit). For a company that almost exclusively sells their stuff through an on-line web site, their on-line order tracking is really poor. I placed my order 2 weeks before Halo 3 was scheduled to ship. I got an email stating an "expected ship date" of September 21st (the Friday before Halo's release). However, when I clicked on the order number to go directly to Dell's site for an update, it said the order (or more presicely a single line-item on the order) wouldn't ship until the 27th. The other line item had no details for the ship date, so was the first line item's ship date also for the entire order?

Naturally, being the instant gratification freak that is typical of my generation, I checked the site for updates several times a day. I even called Dell in an attempt to gain clarification. I was told that this deal was extremely popular, but that it probably wouldn't ship until a day or two AFTER Halo's release. Grrrr.....  But then, on the 21st (this was the original "expected ship date") something went haywire on Dell's order tracking site and it now said an "expected DELIVERY date" of the 24th! Woo-hoo! Hours later, however, and it was back to a SHIP date of the 27th. Boo. I checked again on the morning of the 25th to find that it had actually shipped the day before (though no notification email was sent to me). They shipped it by air, and it actually arrived on the 25th! So, good marks for execution but an F for a rather useless order tracking system.

Anyway, I hooked up my new toy that evening and was relieved to find the cooling fan was much more quiet than my original XBox. I used my original XBox with XBox Media Center to stream video from my PC to my television in the living room and the fan was always distracting. The DVD drive is another story - it is quite noisy when it's in use even though it's the vaunted Benq drive which is supposed to be the most quite DVD drive in the 360s. I'd hate to hear what the noisy ones sound like.

I won't bore you with a review of Halo 3 since the entire gaming community has already given it plenty of thumbs-up. I haven't even played it much yet, though it looks like Halo, feels like Halo, and sounds like Halo. That's a good thing. Since I totally suck, I play on the "easy" setting but in Halo 3 it is way TOO easy - I haven't died yet! I think I'll restart on the normal difficulty setting and see how I fare. Oh, and the new hammer weapon totally rocks!

One thing that I wasn't looking forward to about the 360 was the fact that while it can play video from a PC, it only supports WMV and MPEG video formats. My original XBox with XBMC plays just about every video format on the planet and I like it that way. Thankfully, some clever programmers developed an ingenious (and free, let's not forget free) piece of software that allows you to play just about any video format on the 360. It's called Tversity and what it basically does is "transcode" a video file on-the-fly to an XBox 360 supported format. Since I just upgraded my rig to a quad-core system, I can easily transcode high-def material without breaking too much of a sweat. This is great stuff.

So, I'm quite happy with my new Halo 3 Machine (let's call it what it really is). Hell, I might even try to do the XBox Live multi-player thing too if I can think up a decent gamer tag. My usual nicknames are all taken, so this might take a while. (UPDATE: I am now known as UnhingedBeaker.)

Tags:

Tech | Entertainment | Toys

SQL Server 2005 Syntax Incompatible with SQL Server 2000

On a recent project we use SQL Server 2005 for development but the product officially supports installation on both SQL Server 2005 and SQL Server 2000. During development we'll create tables in the database (using SQL 2005) using the GUI tools in either Visual Studio or Management Studio. When it comes time to create the installation scripts, we'll "Generate CREATE scripts" from these GUI tools. With SQL 2005 (well, at least the version we're using, which is SP2), the CREATE TABLE script will now use a SQL 2005 specific syntax that will not work on SQL 2000.
 
For example, here is an auto-generated script that runs on SQL 2005, but not on SQL 2000:
 
CREATE TABLE [dbo].[Order](
 [orderID] [int] NOT NULL,
 [customerID] [int] NOT NULL,
 [orderDate] [datetime] NOT NULL,
 [shipDate] [datetime] NOT NULL,
 [shipperID] [int] NOT NULL,
 [shipperTrackingNumber] [varchar](50) NULL,
 CONSTRAINT [PK_Order] PRIMARY KEY CLUSTERED
(
 [orderID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
 
If you try to run this on SQL 2000, you'll get the following error:
 
Server: Msg 170, Level 15, State 1, Line 11
Line 11: Incorrect syntax near '('.
 
It would appear as though SQL 2000 does not like the syntax of the primary key constraint included in the CREATE TABLE statement. Alternatively, the following script works on both SQL 2000 and SQL 2005:
 
CREATE TABLE [dbo].[Order] (
 [orderID] [int] NOT NULL ,
 [customerID] [int] NOT NULL ,
 [orderDate] [datetime] NOT NULL ,
 [shipDate] [datetime] NOT NULL ,
 [shipperID] [int] NOT NULL ,
 [shipperTrackingNumber] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
 
ALTER TABLE [dbo].[Order] ADD
 CONSTRAINT [PK_Order] PRIMARY KEY  CLUSTERED
 (
  [orderID]
 )  ON [PRIMARY]
GO
 
Now, if that was the only problem I could probably live with that. But wait! There's more! When you create an object in SQL Server, it's generally good practice to first make sure the object doesn't already exist. In my day-to-day use, my scripts will often check for general objects, or foreign-key constraints. SQL 2005 uses the following code for these operations:
 
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_Order_Customer]') AND parent_object_id = OBJECT_ID(N'[dbo].[Customer]'))
 
Run this on SQL 2000 and you'll get:
 
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'sys.foreign_keys'.
 
Also, the following code is used by SQL 2005:
 
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Order]') AND type in (N'U'))
DROP TABLE [dbo].[Order]
GO
 
which will give you the following on SQL 2000:
 
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'sys.objects'.
 
Microsoft changed the way that meta-data is stored in SQL 2005 to improve security, amongst other things, but this means that these scripts won't work on SQL 2000. Thankfully, however, they did provide "views" in SQL Server 2005 which mimic the old behavior on SQL 2000. To fix these errors on SQL 2000, you can use the following syntax which will work on both SQL 2005 and SQL 2000:
 
IF  EXISTS (SELECT * FROM dbo.sysforeignkeys WHERE fkeyid = OBJECT_ID(N'[dbo].[FK_Order_Customer]') AND rkeyid = OBJECT_ID(N'[dbo].[Order]'))
ALTER TABLE [dbo].[Order] DROP CONSTRAINT [FK_Order_Customer]
GO
 
IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[Order]') AND type in (N'U'))
DROP TABLE [dbo].[Order]
GO
 
Thankfully, there is a way around this if you're using SQL Management Studio. Instead of right-clicking on a table to generate a CREATE script, right-click on the Database and select Tasks -> Generate Scripts. This will open the Script Wizard dialog. On the Choose Script Options page, set the "Script for Server Version" property to "SQL Server 2000" and your CREATE scripts will now be fully compatible. A little more clicking is required, but at least your scripts will work on both server versions.
 

Tags:

SQL Server | Tech