Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Error Using BCP

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-15 : 08:57:08
Ralph writes "I sent a message the other day regarding an error I was getting using BCP and other executables in stored procedures.

Just wanted to let you know that the problem was in the server setup. All works great now.

I have another question though. I want to dump the data using BCP to a shared folder on another server. I'm getting the error "Unable to open BCP host data-file" when using something like the following as the output file name "\\SERVER\FOLDER\FILE.TXT".

I believe it has something to do with permissions on the remote folder. Is there a way to pass a login id and password so that the stored procedure has access to the remote folder?

Thanks
Ralph Ewry"

Nazim
A custom title

1408 Posts

Posted - 2002-01-15 : 10:27:23
This is the Syntax of Bcp. Pass the login and password using -U and -P options as you can make it out from the sytax.

bcp {[[database_name.][owner].]{table_name | view_name} | "query"}
{in | out | queryout | format} data_file
[-m max_errors] [-f format_file] [-e err_file]
[-F first_row] [-L last_row] [-b batch_size]
[-n] [-c] [-w] [-N] [-6] [-q] [-C code_page]
[-t field_term] [-r row_term]
[-i input_file] [-o output_file] [-a packet_size]
[-S server_name] [-U login_id] [-P password]
[-T] [-v] [-R] [-k] [-E] [-h "hint [,...n]"]

HTH

----------------------------------
"True love stories don't have endings."
Go to Top of Page
   

- Advertisement -