Solved

bcp folder path

Posted on 2011-09-30
3
288 Views
Last Modified: 2012-05-12
I'm having some problems with the folder path I've been given

part of the path has a space in it.

Is there a way to handle this or should I have the user rename the folder?
SET @bcpCommand = @bcpCommand + ' \\fileserver\Shares\marketing\media data\dumpfile_' + replace(convert(varchar(10),getdate(),110),'-','') + '.csv -c -t"," -U webPortal -P webP!we%X'

Open in new window

0
Comment
Question by:lrbrister
3 Comments
 
LVL 21

Accepted Solution

by:
JestersGrind earned 500 total points
ID: 36893083
You can have the user change the path or put the path inside double quotes, like this.

SET @bcpCommand = @bcpCommand + '" \\fileserver\Shares\marketing\media data\dumpfile_' + replace(convert(varchar(10),getdate(),110),'-','') + '.csv" -c -t"," -U webPortal -P webP!we%X'

Greg
0
 
LVL 8

Expert Comment

by:Leo Torres
ID: 36893096
Can you post first part of bcp

bcp command need double qoutes " " when a select statement is involed

ie
Set @cmd            = 'bcp " '+ @outputSQL +' " queryout "' + @CompletedFilePath +'" -T -c -t^,'



0
 

Author Closing Comment

by:lrbrister
ID: 36893126
That was it...both worked.  Thanks
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to shrink a transaction log file down to a reasonable size.

816 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

8 Experts available now in Live!

Get 1:1 Help Now