cut table in chunks of 65000 records

lala

Registered User.
Local time
Today, 07:27
Joined
Mar 20, 2002
Messages
741
is there a way of doing that?
let's say there's a table with 1000000 rows and i need to export it into excel, and we all know that excell will only take 65000

how can i cut it up in chinks of 65000 and make sure i'm not missing any records?

thank you!
 
If you move to Office 2007 you can export it all. :D

Which version are you currently on?
 
lololololo
cool, i didn't know that

but this is for work, and they're on 03
 
Pointer: SELECT TOP.

1. Get the first 65000 records, ordered. Store the key for the last record.
2. Get the next 65000 records, WHERE key > KeyFromPreviousStep. Store the key for the last record.
3. GoTo 2.
4. Try to get out of previous loop. Oops..

Don't know if you can export a recordset, though :D.

Parting thought: Wouldn't it be handier to just make a copy of the database?
 
yes, it would
some people in this company insist on getting their data in Excel

but i'm with you on this



i just thought maybe there's an easy way of doing this
i already showed them how to do it, but thought there's a prettier way

i said to just go to the 65000 records, note the ID number, export
and do everything you said, just by hand

and then posted here, just in case someone knows an easy better way without using code (they won't know how)
 
some people in this company insist on getting their data in Excel
People who want one million records in spreadsheets are, er, induhviduals. If it's your manager, run :D.
 
it's a little less, 500000


no, it's not my manager lolol
and not even my department
i'd ran a while ago if it was
someone asked me a question and it got me going, still thinking about it
 

Users who are viewing this thread

Back
Top Bottom