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 doubt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-12-02, 01:57
sachin shukla sachin shukla is offline
Registered User
 
Join Date: Dec 2001
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 02-14-02, 05:43
willy_and_the_ci willy_and_the_ci is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 02-19-02, 05:17
prithvi prithvi is offline
Registered User
 
Join Date: Feb 2002
Location: India
Posts: 9
Re: BCP doubt

Quote:
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.
Reply With Quote
  #4 (permalink)  
Old 03-20-03, 15:23
archersl archersl is offline
Registered User
 
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
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