November 22, 2013 at 5:40 am
Hi all,
How would I split a table into multiple chunks of 2000 records? example: I have a table with 123000 rows, how would I split it into multiple tables of 2000 records each?
thanks for all the help.
November 22, 2013 at 6:47 am
Copy the data to a new table if you want to keep the original data
Then select top 2000 from source table into new table
Delete top 2000 rows from source table
Repeat until no data left
Far away is close at hand in the images of elsewhere.
Anon.
November 22, 2013 at 7:35 am
phamm (11/22/2013)
Hi all,How would I split a table into multiple chunks of 2000 records? example: I have a table with 123000 rows, how would I split it into multiple tables of 2000 records each?
thanks for all the help.
Why are you trying to split 123,000 rows into 62 tables each with 2,000 rows? I know you were given a solution but the problem is so strange I have to ask what you trying to accomplish here. Why 2,000 rows?
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply