Table name parsing fix for MS-SQL

This addresses the issue in determining the table name when nested select statements are used as FROM statements.

I highly suggest we revisit the statement that is generated so that nested select statements are used when limiting rows.