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
 Export query to an Excel file

Author  Topic 

nounabarbie
Starting Member

10 Posts

Posted - 2006-02-27 : 04:06:01
Hi,
I want to send the result of my query to an Excel file.How can I do it?

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-02-27 : 04:26:59
Use BCP Utility
bcp "SELECT au_fname, au_lname FROM pubs..authors ORDER BY au_lname" queryout Authors.xls -c -Sservername -Usa -Ppassword

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-02-27 : 04:27:48
also refer to here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

----------------------------------
'KH'


Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-02-27 : 05:01:50
quote:
Originally posted by shallu1_gupta

Use BCP Utility
bcp "SELECT au_fname, au_lname FROM pubs..authors ORDER BY au_lname" queryout Authors.xls -c -Sservername -Usa -Ppassword




It will be saved as Text(Tab delimited) format

Madhivanan

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

- Advertisement -