Hello all,
What is the proper SQL to use for this senario:
Insert all records into table1 from table2 and commit after every 10000 rows until complete.
The solution proposed looks absolutely fine - unless your initial problem was tempdb space, in which case you're just as likely to get the problem when the temporary table is loaded.
Is there any value that you can use to divide the source table into (approximately) equal chunks? For example, I had to grab 1.4M rows from one table to another to build a test set. Fortunately there's an ID number, so I was able to grab the rows by their trailing digit (i.e. mod 10) using
"Where ID - 10 * Floor(ID / 10) = 0".
If that's no good, what about dates? Or a character column? Anything that you can use to create useful subdivisions.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.