Monday 21 February 2011

Cannot resolve the collation conflict

I've been working recently on databases that contain different collations. Mainly the following two:
  • SQL_Latin1_General_CP1_CI_AS
  • Latin1_General_CI_AS
When trying to write simple queries I kept getting the following error:

Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.

To solve this you just need to cast the field to the correct collatiion using COLLATE Latin1_General_CI_AS
Example.

SELECT *
FROM Table1INNER JOIN Table2

ON Table1.ID = Table2.ID
WHERE Table1.ID = 1


This would become

SELECT *
FROM Table1INNER JOIN Table2

ON Table1.ID COLLATE Latin1_General_CI_AS = Table2.ID
WHERE Table1.ID = 1

Friday 4 February 2011

Blank or Empty lists for Windows Features

I've seen this issue a few times where the "Turn Windows features on or off" window is empty, stopping you from installing or uninstalling a feature.

Microsoft's solution is to perform a "System Restore" which is quite a drastic action.

There is a more viable fix for this issue available here:
FIX Blank or Empty List in Vista Turn Windows Features On or Off (OptionalFeatures.exe)