Adding support for the Teradata adapter, which is similar to the MSSQL adapter.

I am just adding the adapter for Teradata to the same when clause as the MSSQL adapter as they have the same subquery limitations and the code provided here for MSSQL works for Teradata as well.