Solved

bcp folder path

Posted on 2011-09-30
3
283 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
Comment Utility
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
Comment Utility
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
Comment Utility
That was it...both worked.  Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

728 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

11 Experts available now in Live!

Get 1:1 Help Now