Solved

bcp folder path

Posted on 2011-09-30
3
290 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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 to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

856 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