Tag Archives: Compatibility Mode

A SQLServer 2005 Gotcha

We’ve just come up against a bit of a gotcha with Microsoft SQLServer 2005.

We’ve been working on a bespoke system for a customer for the past few months, and have been regularly testing against their test databases that they have been sending over, and they’ve been doing the same. Today the system was set up against their live database for the first time, at which point we got an “Ambiguous column name” error being generated whenever they loaded one of their custom query configurations into our system.

This not surprisingly had us flummoxed for a long while, and it wasn’t until I found this blog post that I nailed down what the problem actually is – SQL Server compatibility modes.

The test database that we have been using was originally created on SQL Server 2000, so when it is attached in SQL Server 2005 the system automatically sets the compatibility mode to 80 – the code for SQL Server 2000. Their live database however has recently been recreated in SQL Server 2005, so when that is attached the compatibility mode defaults to SQL Server 2005, and SQL Server 2005 is a lot more picky about certain bits of SQL syntax. As a result their custom query that works fine on the test system, that reuses a particular column twice and sorts by the same column falls foul of the new syntax rules.

Obviously you can get around the problem by switching the compatibility mode back on the new database, but longer term we’ll need to fix the problem.

It’s not the only change between SQL Server 2000 and SQL Server 2005 either – there is a pretty extensive list of all the changes with a probable impact on this blog post.

Word 2007 Compatibility Mode Gotcha

Working as we are in a situation where some of the machines have been upgraded to Office 2007 and others haven’t, we’re quite used to running the new applications in compatibility mode to ensure that our Office 2003 brethren are able to read our documents. In general operation it all seems to work fairly well, however it seems the compatibility mode has a bit of a gotcha when it comes to floating graphics. Working with a document that has some floating images, which totally scrambled the layout on an Office 2003 box, and investigating it transpires that floating text boxes in Office 2003 come out significantly larger than on Office 2007 – taking our problem document it looked like Office 2003 was adding the equivalent of blank line, and in addition all the borders around the text boxes were noticeably thicker.