New feature! Upgrade and increase expert visibility of your issues with Priority Questions.
CREATE PROCEDURE FINAL_BATCH_INS AS DECLARE @BatchSize INT = 5000 WHILE 1 = 1 BEGIN INSERT INTO customer_final WITH (TABLOCK) (ID,Name,Area,CheckSum) SELECT TOP(@BatchSize) ID,Name,Area,CheckSum FROM customer WHERE NOT EXISTS (select 1 from customer_final where customer_final.CheckSum = customer.CheckSum) IF @@ROWCOUNT < @BatchSize BREAK END GO
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.