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 2005 Forums
 Transact-SQL (2005)
 BCP will not allow

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2009-11-10 : 12:32:19
Server administrator will not allow the code below to export file.

Exec Master..xp_cmdshell 'bcp "Select * from authors" queryout "C:\testing.xls" -c'

Is there another way to export a table as xls file?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-10 : 12:37:30
You could simply run the bcp command from a cmd window rather than through xp_cmdshell.

You could also export the data out via SSIS or the export wizard, both allow XLS files.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -