Solved

bcp folder path

Posted on 2011-09-30
3
294 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

623 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