If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > BCP data from one table to another

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-09-02, 11:41
briang123 briang123 is offline
Registered User
 
Join Date: Apr 2002
Posts: 1
Smile BCP data from one table to another

I am trying to bcp data from a database table on one server to another on another server. I would like to put this into a shell script and have it run nightly.. Anyone have any suggestions??

Thanks
Brian
Reply With Quote
  #2 (permalink)  
Old 04-09-02, 22:35
raju raju is offline
Registered User
 
Join Date: Jan 2002
Posts: 28
Brian,

Can I know whether two servers are available in the same box. if it is different box then you have to out the data from source server and ftp the data to the target server and do the bcp in...

best of luck

raju
Reply With Quote
  #3 (permalink)  
Old 03-20-03, 14:42
archersl archersl is offline
Registered User
 
Join Date: Mar 2003
Posts: 2
The Sybase DBAs for our network do use a setup that lets us bcp (and isql) to a server on another box while staying on our own. If you can get this set up, you should be able to run both your bcp in and your bcp out statements from within your script.
Sara
Reply With Quote
  #4 (permalink)  
Old 03-21-03, 09:48
svelasco svelasco is offline
Registered User
 
Join Date: Jun 2002
Location: Argentina
Posts: 78
I do that all the time. Is very simple. You must declare the other server into the interfaces file or sql.ini (NT). You can do it that with dsedit(NT) or dscp(Unix term). If you can connect with isql It's ok.
If you need run every night you must write and script like that and put in your cron:

#!/usr/bin/ksh
#

OUTPUT=$0$$
bcp server1.dbo.table out $OUTPUT -c -X -e $OUTPUT.err -Stgssybde -Uuser1 -Ppassword1
bcp server2.dbo.table in $OUTPUT -c -X -e $OUTPUT.err -Stgssybde -Uuser2 -Ppassword2
rm $OUTPUT

The problem here is that you must write the password for two users :-(
Bye

Sebastian
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On