Link to home
Start Free TrialLog in
Avatar of rohanbairat3
rohanbairat3

asked on

Database to Excel

I have a table which contains about 150000 rows and i need to copy it to excel file ... I cannot copy it to one single excel file and I dont have a row element or id assosiated with it ....

Can any one let me know if there is a way to do it

-rohan
Avatar of ShogunWade
ShogunWade

Excel has a limit of 64K rows per sheet so you would have to split it into multiple sheets.
Avatar of Partha Mandayam
use a query to split the table into groups of 64k rows based on primary key condition. Then export each one into a separate sheet in the excel file
Avatar of rohanbairat3

ASKER

there is no priimary keu on that table ...

-rohan
Split it on a different field then
split on a date field or something like that
There is most likely some combination of columns that will make each row unique. If you post your column definition and what is in each column, I am sure we can help more. There's also VBA stuff in the Excel forum that addresses the problem. You may want to ask an expert there.
yeah ... does anyone know about splitting a table depending on rows if there is no primary key ?

thanks for the help ... i know we can do that but thats not a generic way ... i want a way to split sql server tables ...

say top 10000 in first and then 100000 in other and so on
-rohan
I am going to add a seperate column and put a row id in it .

-thanks guys
add an identity column which will automatically populate and then you can split on that.
What are you trying to achive??  Displaying a report with that many rows is unweildly.  What are you using the excel data for?  You may be better served passing the data into a pivot cache which can handle the number of rows that you require.

You can still get access to portions using the pivot tables ability to drill down into the data that comprises the pivot.

Cheers Sash
We provide some kind of data to our customers and they want it in excel format ... :)

-rohan
ASKER CERTIFIED SOLUTION
Avatar of SashP
SashP

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial