Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

SQL Server bcp command

I have to cammand below which is crewating a file...just not actually in excel format.  So I know I have my switches wrong for export to excel.

Some help here?

exec master.dbo.xp_cmdshell 'bcp "select * from database.dbo.table1" queryout C:\excelfile.xls -w -S SERVER\INSTANCE -T -E'
0
lrbrister
Asked:
lrbrister
  • 2
1 Solution
 
BrandonGalderisiCommented:
It won't.  You would have to export into character format which created a TAB delimited file and then import that into excel.  Just hope your data contains no tabs.
0
 
BrandonGalderisiCommented:
Here is a link to the BCP utility syntax.

http://msdn.microsoft.com/en-us/library/aa174646(SQL.80).aspx
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now