changes to fix problems with CF9 and MSSQL 2008

There, I think this should be on the right branch now.