I'm a newbie in SQL Server and have the following dilemma:
I have two tables with the same structure. Call it runningTbl
and finalTbl
.
runningTbl
contains about 600 000 to 1 million rows every 15 minutes.
After doing some data cleanup in runningTbl
I want to move all the records to finalTbl
.
finalTbl
currently has about 38 million rows.
The above process needs to be repeated every 15-20 minutes.
The problem is that the moving of data from runningTbl
to finalTbl
is taking way longer than 20 minutes at times..
Initially when the tables were small it took anything from 10 seconds to 2 minutes to copy.
Now it just takes too long.
Any one that can assist with this? SQL query to follow..
Thanks