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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Export to Excel

Author  Topic 

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-05-13 : 05:44:48
I used bcp to export data to Excel file
master..xp_cmdshell 'bcp "select * from MyDB..Test" queryout "D:\ex.xls" -c'
It is working. But It is actually stored as Text(Tab Delimitated) type. I have to open it and do saveas and select "Microsoft Excel Workbook" to actually save it as Excel file. Is there any way to avoid this?

Madhivanan

Failing to plan is Planning to fail

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2005-05-13 : 06:00:23
You can use DTS to export the data directly to an Excel file.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-05-13 : 06:03:29
Isnt possible from Query itself?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -