Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export a certain number of records

Status
Not open for further replies.

lb1

Technical User
Apr 19, 2002
109
US
I have a table with 100000 records and I would like to export these to a few text files. For example the records 1 to 15000 to A1.TXT, 15001 to 25000 to A2.txt etc....
Is there a query I can use to do this?
Thanks
Louis
 
Two options (that I can think of):

1. To use a query I'd use the "Top" statement...then you can select how many records the query actually pulls. You'd have to do some work to get it to pull the middle section of data (ie not the first set and not the last set), but it could be done.

2. I think I'd go with doing this in code...it wouldn't be hard, just loop through however many records you want and export them to a text file as you go.

Hope that helps.

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top