using sql server 2008
I would like to take a table that has 11 million records and divide them into chunks of 50000 each while maintaining the original table and just making sure each chunk contains unique records.
If I select top 50000 records for the first batch, how can I guarantee I get the next 50000 and so on.
Use the ranking functions, in particular row-number():