Fix compatibility with MS SQL