Results 1 to 4 of 4

Thread: BCP doubt

  1. #1
    Join Date
    Dec 2001
    Posts
    2

    Unanswered: BCP doubt

    I am having a doubt with bcp. We are doing bcp transfer of some tables from a source sybase database on one server to a target sybase database on another server. While tranferring a big table from a file in source to target the network connection fails. Now will it happen that the bcp will have inserted some rows.
    I want to find out can we rely on bcp that if we are inserting some rows into the target using it, either all the rows will get successfully inserted or none of them will get inserted and bcp will give an error. Since if that is not the case we will have to provide a recovery mechanism on top of bcp

  2. #2
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    Sachin,

    BCP generates the data into a flat file. You can simply copy or ftp this flat across to yout detsination server and use the local bcp to insert this data into the network. This will eliminate your fears about loosing network connection.

    Alternatively, if these are both Sybase Servers. The best way to move data across is to use CIS and create proxy and simply do a SELECT INTO.

    Adios

    Willy

  3. #3
    Join Date
    Feb 2002
    Location
    India
    Posts
    9

    Re: BCP doubt

    Originally posted by sachin shukla
    I am having a doubt with bcp. We are doing bcp transfer of some tables from a source sybase database on one server to a target sybase database on another server. While tranferring a big table from a file in source to target the network connection fails. Now will it happen that the bcp will have inserted some rows.
    I want to find out can we rely on bcp that if we are inserting some rows into the target using it, either all the rows will get successfully inserted or none of them will get inserted and bcp will give an error. Since if that is not the case we will have to provide a recovery mechanism on top of bcp
    Hi,

    use -b option in bcpin.if use -b option it wount cut's from the network fails.

  4. #4
    Join Date
    Mar 2003
    Posts
    2
    using the -b option on a bcp in sets the number of rows that are inserted before a commit. If you have a 20,000 row file to bcp in and you use
    the -b5000 , then the insert statement will commit after every 5000 rows. If you have NO -b option, then the inserts are only comitted after ALL rows are loaded. If the load fails, ALL rows are then backed out. Only problem is that sometimes you will get stuck because the transaction log gets full.

    Sara

Posting Permissions

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