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)
 can bcp to another server ?

Author  Topic 

reenz
Starting Member

29 Posts

Posted - 2006-04-10 : 03:47:32
Is it possible to do something like that
exec master..xp_cmdshell 'bcp "SELECT * FROM settings" queryout "http://1.2.3.4/test.txt" -c' OR
exec master..xp_cmdshell 'bcp "SELECT * FROM settings" queryout "\\1.2.3.4\test.txt" -c'


I am getting an error
Error = [Microsoft][ODBC SQL Server Driver]Unable to open BCP host data-file

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-04-10 : 04:37:37
not sure about the first option but 2nd option yes, but you need to have the necessary permissions on the location to create the file,
also you might want to anticipate that if you get disconnected the task will fail

another option is to save it locally then copy it over the target location

the error tells you that it cannot find/create the file you specified


HTH

--------------------
keeping it simple...
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-10 : 07:40:44
>>exec master..xp_cmdshell 'bcp "SELECT * FROM settings" queryout "\\1.2.3.4\test.txt" -c'

You should use shared Folder or Drive

exec master..xp_cmdshell 'bcp "SELECT * FROM settings" queryout "\\1.2.3.4\shared_folder\test.txt" -c'

or

Follow what jen suggested


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -