Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

bcp folder path

Posted on 2011-09-30
3
Medium Priority
?
296 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

722 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