bcp
Description
Copies a database table to or from an operating system file in a user-specified format. bcp is located in $SYBASE/OCS-12_5/bin.
In Windows NT, the utility is bcp.exe, and is located in %SYBASE%\OCS-12_5\bin.
bcp
Description
Copies a database table to or from an operating system file in a user-specified format. bcp is located in $SYBASE/OCS-12_5/bin.
In Windows NT, the utility is bcp.exe, and is located in %SYBASE%\OCS-12_5\bin.
Syntax
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]
[-A packet_size]
[-J client_charset]
[-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]
Or
bcp -v
Parameters
database_name
is optional if the table being copied is in your default database or in master. Otherwise, you must specify a database name.
owner
is optional if you or the Database Owner owns the table being copied. If you do not specify an owner, bcp looks first for a table of that name that you own, and then looks for one owned by the Database Owner. If another user owns the table, you must specify the owner name or the command fails.
view_name
is the name of the view you are copying out.
table_name
is the name of the database table to copy. The table name cannot be a Transact-SQL reserved word.
Partition number partition_number does not exist in table table_name.
slice_number
is the number of the slice of the database table to copy.
partition_id
is the identifier of the partition into which to copy.
in | out
is the direction of the copy. in indicates a copy from a file into the database table; out indicates a copy to a file from the database table or view.
datafile
is the full path name of an operating system file. The path name can be from 1 to 255 characters in length.
-m maxerrors
is the maximum number of nonfatal errors permitted before bcp aborts the copy. bcp discards each row that it cannot insert (due to a data conversion error, or an attempt to insert a null value into a column that does not allow them), counting each rejected row as one error. If you do not include this parameter, bcp uses a default value of 10.
-f formatfile
is the full path name of a file with stored responses from a previous use of bcp on the same table. After you answer bcp's format questions, it prompts you to save your answers in a format file. Creation of the format file is optional. The default file name is bcp.fmt. The bcp program can refer to a format file when you are copying data so that you do not have to duplicate your previous format responses interactively. Use the -f parameter only if you previously created a format file that you want to use now for a copy in or copy out. If you do not specify this parameter, bcp interactively queries you for format information.
-e errfile
is the full path name of an error file where bcp stores any rows that it was unable to transfer from the file to the database. Error messages from bcp appear on your terminal. bcp creates an error file only when you specify this parameter.
-F firstrow
is the number of the first row to copy from an input file (default is the first row).
Avoid using the -F option when performing heavy-duty, multi-process copying, as it causes bcp to generally spend more effort to run, and does not provide you with a faster process. Instead, use -F for single-process, ad-hoc copying.
-L lastrow
is the number of the last row to copy from an input file (default is the last row).
-b batchsize
is the number of rows per batch of data copied (the default is to copy all the rows in one batch). Batching applies only when you are bulk copying in; it has no effect on bulk copying out. The smallest number bcp accepts for batchsize is 10. If you specify a smaller nu






