WHILE((SELECT COUNT(*) FROM tbl_craigslist_leads )>0)
begin try
insert into server_table select TOP(1)* from tbl_craigslist_leads
end try
begin catch
if @@Error=2627
begin
SELECT ERROR_NUMBER() AS ErrorNumber
delete top(1) from Local_table
end
end catch
i want to know no of records inserted to server table
↧