Fixed to get the SQL Server stuff working with the latest code