Improved database type detection for SQL Server