Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to export data from sql 2000 to excel

Author  Topic 

roizanladiero
Starting Member

5 Posts

Posted - 2010-09-12 : 22:38:02
Hi Sir/Madam,

How can i export the data coming from database it is more than 1000 records?



Thanks,
RIL

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-09-13 : 00:06:19
the simplest way to do it is to run SELECT statement against your table or query and copy/paste results to excel.
or you can export a table to excel using EXPORT.
or you can even DTS package to save your data to excel.
or you can write query to store data in excel using INSERT INTO OPENROWSET:

insert into openrowset('Microsoft.Jet.OLEDB.4.0','excel 9.0;Database=C:\test.xls;','select column1,column2,column3 from [Sheet1$]')
select column1, columns2, column3 from MyTable
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2010-09-13 : 02:15:05
Have a look on

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

roizanladiero
Starting Member

5 Posts

Posted - 2010-09-13 : 02:37:19
quote:
Originally posted by slimt_slimt

the simplest way to do it is to run SELECT statement against your table or query and copy/paste results to excel.
or you can export a table to excel using EXPORT.
or you can even DTS package to save your data to excel.
or you can write query to store data in excel using INSERT INTO OPENROWSET:

insert into openrowset('Microsoft.Jet.OLEDB.4.0','excel 9.0;Database=C:\test.xls;','select column1,column2,column3 from [Sheet1$]')
select column1, columns2, column3 from MyTable


@slimt_slimt: Have errors appeared when i run your code hope you can help me. here is the error:
[OLE/DB provider returned message: Could not find installable ISAM.]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IDBInitialize::Initialize returned 0x80004005: ].
Msg 7399, Level 16, State 1, Line 2
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.


Go to Top of Page
   

- Advertisement -