Merge pull request #1 from Nick011/moes_changes

Moes changes
changed mssql systable query

moved the where name in back to the constructed variable and change the
else ms_tables to return empty…
db fixes and coding errors

a couple of coding errors fixed, made a change to the if/else statement
so that it can pull back all the tables or views if none are defined.

functions : check_table_exists was closing the cursor so removed those
lines

added commas to sqlserver_datatypes that were missing
Merge pull request #2 from sfmoe/master

Coding Fixes and such