Fix moving of dangling TaskInstance rows for SQL Server (#19425)
Fix moving of dangling TaskInstance rows for SQL Server (#19425)

SQL server uses a different syntax for creating a table from a select to
the other DBs we support.

And to make the "where_query" reusable across all DBs (SQL Server
doesn't support `WHERE (col1,col2) IN ...`) the delete has been
re-written too.
apache/airflow,nathanielvarona/airflow,cfei18/incubator-airflow,apache/airflow,bolkedebruin/airflow,apache/airflow,lyft/incubator-airflow,danielvdende/incubator-airflow,danielvdende/incubator-airflow,nathanielvarona/airflow,Acehaidrey/incubator-airflow,nathanielvarona/airflow,mistercrunch/airflow,lyft/incubator-airflow,bolkedebruin/airflow,cfei18/incubator-airflow,lyft/incubator-airflow,mistercrunch/airflow,nathanielvarona/airflow,Acehaidrey/incubator-airflow,bolkedebruin/airflow,cfei18/incubator-airflow,mistercrunch/airflow,Acehaidrey/incubator-airflow,danielvdende/incubator-airflow,cfei18/incubator-airflow,danielvdende/incubator-airflow,Acehaidrey/incubator-airflow,bolkedebruin/airflow,lyft/incubator-airflow,Acehaidrey/incubator-airflow,Acehaidrey/incubator-airflow,danielvdende/incubator-airflow,mistercrunch/airflow,nathanielvarona/airflow,danielvdende/incubator-airflow,nathanielvarona/airflow,apache/airflow,apache/airflow,apache/airflow,bolkedebruin/airflow,cfei18/incubator-airflow,cfei18/incubator-airflow