[bug] Fix errors Database=>Fix on MSSQL. Fixes #2517.