Export Table to Excel (1 Viewer)

zezo2021

Member
Local time
Today, 03:23
Joined
Mar 25, 2021
Messages
387
Hello friends

What should I do if the table contains over 3 Million records for example?

should I create 3 views?

and convert it to Excel (each one separately)

or is there an easy solution in SQL SERVER MANAGEMENT STUDIO
 

Minty

AWF VIP
Local time
Today, 02:23
Joined
Jul 26, 2013
Messages
10,371
Assuming you can identify the records by some ID, and you have linked it to Access, write a routine that breaks it down into manageable chunks (say 750,000 records) and use that to export it.

Be warned it won't be quick, no matter how you do it.

Excel has a 1048576 row limit, but files get very unwieldly as they approach this limit.
You could save a CSV out of SSMS - https://dba.stackexchange.com/questions/58533/copy-a-large-data-from-sql-query-result
 

Ranman256

Well-known member
Local time
Yesterday, 21:23
Joined
Apr 9, 2015
Messages
4,337
i made a range in criteria to export the ID in batchs
[id] < 1,000,000
[id] between 1,000,001 and 2,000,000
[id] > 2,000,001


DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12xls, "query1", vFile, True,"qry1"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12xls, "query2", vFile, True, "qry2"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12xls, "query3", vFile, True, "qry3"
 

Users who are viewing this thread

Top Bottom