I have the following script with more than 20,000 records in each table:
With registration dates from January to February 2018:
INSERT Table_que_usare (Usuario, IDUnica, servidor)
select Usuario, IDUnica, servidor
from table1
With registration dates from March to May 2018:
INSERT Table_que_usare (Usuario, IDUnica, servidor)
select Usuario, IDUnica, servidor
from table2
With registration dates from August to December 2018:
INSERT Table_que_usare (Usuario, IDUnica, servidor)
select Usuario, IDUnica, servidor
from table3
In each database there is more than one user repeated, I want to know if there is any way to make the selection that checks me if the user does not exist, then insert the data and those that do not exist are all inserted to the exclusion of the repeated ones.
NOTE: Take into account that the databases come from more than 3000 SQL Server 2008 R2 backups.