BCP is generally stored in the installed ASE or open Client Bin directory. The 12 version of the previous ASE,BCP storage directory for the $SYBASE/bin,12 version (including 12 versions) after the storage directory for $SYBASE/ocs-12_x/bin. Where $sybase is the Sybase installation directory, 12_x represents version 12.0, 12.5, displayed as 12_0 or 12_5, executable file name is called bcp. Exe.
The list of parameters is as follows: (Available bcp–)
USAGE:BCP [[database_name.] Owner.] Table_name[:slice_number] {in | out} datafile
[M maxerrors] [F FormatFile] [-E Errfile]
[F FirstRow] [-L LastRow] [B batchsize]
[-N] [-c] [-T Field_terminator] [R Row_terminator]
[-u username] [-p password] [I. Interfaces_file] [-s server]
[-A Display_charset] [Q Datafile_charset] [Z Language] [-V]
[-A Packet size] [-j client Character Set]
[-T-text or image size] [-E] [G Id_start_value] [-N] [-X]
[M LabelName Labelvalue] [-labeled]
[k Keytab_file] [R Remote_server_principal]
[-V [security_options]] [Z security_mechanism] [Q]
The usual data backup format is:
BCP dbname ... TableName out C:\temp\filename-usa-ppassword–sservername–c
Where –u is the Sybase login name after –p, the Sybase login password after –s, and the Sybase service name after the –C representative uses the visible text method to export the data, and if you need to replace out with in for data recovery.
You can generate an execution script that exports data from all tables in one database at a time.
Edit one of the following text files, with the file name example Bcpscript:
Use dbname to select the database to which you want to export data
Go
Select ' bcp dbname. ' + name + ' out c:\temp\ ' + name + '-usa-p-ssybcdsrv-c ' from sysobjects where type = ' U ' (in Sysobj The table with type U in the ECTS system table is the user table and the system table is s)
Go
Executed in the following format:
Isql–usa–ppassword–sservername–i Bcpscript–o Bcpout.bat (after i parameter for input file, o parameter after file for input file after execution of output file)