Fixed MS SQL issue, closes #736