Making it work for SQL Server (grrr!).