Fix crash with SQL Server driver