Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Posts
    1

    Smile Unanswered: 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

  2. #2
    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

  3. #3
    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

  4. #4
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •