MS SQL Server support

Now support Microsoft SQL Server!
And a few minor changes.