Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bcp Problem! (pulling my hair out)

Status
Not open for further replies.

MKVAB

Programmer
Dec 2, 2003
86
US
Uhg! For the life of me I can't figure this out!!!

I have a command that bcp's to a remote server (Windows). Works fine. I want to do the exact same thing to a remote server running Linux but I have been very unsuccessful. This is what I have:
Code:
EXEC master..xp_cmdshell 'bcp "SELECT * FROM ##Table" queryout, /home/users/dir1/Download/test.out -S[IP] -U[username] -P[passwd]'

The error I'm getting is:
Code:
SQLState = 08001, NativeError = 17
Error = [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
SQLState = 01000, NativeError = 2
Warning = [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()).

I was thinking, maybe this is outside the scope of bcp? So I was going to tackle it a different way. I used bcp to create a file on my windows server and was going to move it from there to my linux box using pscp:
Code:
EXEC master..xp_cmdshell 'pscp \\WindowsServer\dir1\File [username]@[IP]:/home/dir1/test.out -pw [passwd]'

The error I'm getting using pscp is:
Code:
Fatal: More than one remote source not supported

Frustrating!!!
There must be a way to do this!!!

Ideas anybody?!?!?!

-MK
 
Have you tried creating an ftp server and using ftp?

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Thanks for the reply Nigel.

I didn't think FTP could do remote-to-remote across platforms?
 
I managed to get it to work using pscp. My trouble before was that I was passing the password parameter in the wrong place.

Here's what works:
Code:
pscp -pw passwd \\WindowsServer\Dir1\test.out username@IP:/home/users/dir/test.out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top