got it working with mssql

Got it working with mssql with a few changes to the SQL for sys tables. Also needed to change all %d integer formats to %s as python was complaining. 

The `try`...`except` clause at db.py:261 was necessary to get past a column name containing a unicode character. Could be implemented much better, and isn't necessary for python 3.

It's sloppy, but it works.