changed mssql systable query

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