Solved

SQL Server bcp command

Posted on 2008-10-03
2
236 Views
Last Modified: 2012-05-05
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
Comment
Question by:lrbrister
  • 2
2 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22634677
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
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 500 total points
ID: 22634681
Here is a link to the BCP utility syntax.

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

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now