Sql 在两个表之间计时,方法将不同。 begin tran truncate table tableA; insert into TableA select * from TableB; commit; select primary_key, hashbyte
在两个表之间计时,方法将不同。Sql 在两个表之间计时,方法将不同。 begin tran truncate table tableA; insert into TableA select * from TableB; commit; select primary_key, hashbyte,sql,sql-server,sql-server-2016,Sql,Sql Server,Sql Server 2016,在两个表之间计时,方法将不同。 begin tran truncate table tableA; insert into TableA select * from TableB; commit; select primary_key, hashbytes('md5', lower(concat(columna,columnb,columnc))) "hash" from tableA except select primary_key, hashbytes('md5', lower(conc
begin tran
truncate table tableA;
insert into TableA select * from TableB;
commit;
select primary_key, hashbytes('md5', lower(concat(columna,columnb,columnc))) "hash"
from tableA
except
select primary_key, hashbytes('md5', lower(concat(columna,columnb,columnc))) "hash"
from tableB
/* using example code above .... */
delete from tableA where exists (select 1 from TableB where pk = pk and hash <> hash);
insert into tableA select * from TableB where not exists (select 1 from tableA where pk = pk);