What is the SQL to do the following in SQL Server:
I want to take rows from tbl_A and insert the distinct grouping of them into tbl_B.
If tbl_B doesn't yet exist, I want tbl_B to be created exactly like tbl_A, but receive only the distinct grouping of tbl_A's rows.
If tbl_B already exists, I still want the same data inserted but I want all existing rows in tbl_B to be deleted beforehand.
Of course, I need to do this across multiple tables (about 100).
Also, at the expense of stating the obvious, I do not want to have to specify any column names anywhere. The only parts of the script that should need to change as I do this for each pair of tables is the table names. Thanks!