Before using bcp, you need to provide it with basic data information and prepare both the data for transfer and the command to access the data.
You must supply the following information to transfer data successfully to and from Adaptive Server:
Name of the database and table or view
Name of the operating system file
Direction of the transfer (in or out)
You can also use bcp to modify the storage type, storage length, and terminator for each column if you want to do so.
You must have an Adaptive Server account and the appropriate permissions on the database tables or views, as well as the operating system files to use in the transfer to use bcp.
To copy data into a table, you must have insert and select permission on the table.
To copy a table to an operating system file, you must have select permission on the following tables:
the table to copy
sysobjects
syscolumns
sysindexes
Before you can use bcp in, you must prepare the command and the data for transfer:
To use either fast or slow bcp, set select into/bulkcopy/pllsort to true. For example, to turn on this option for the pubs2 database, you would enter:
sp_dboption pubs2, "select into/bulkcopy/pllsort", true
For more information, see “bcp modes”.
To use fast bcp, remove indexes and triggers on the target table. For more information about this requirement, see “bcp performance”.
In addition:
If you are running Open Client version 11.1 or later and are using an external Sybase configuration file, you must addthe following to enable bcp:
[BCP]
You must set the SYBASE environment variable to the location of the current version of Adaptive Server before you can use bcp.
To use a previous version of bcp, you must set the CS_BEHAVIOR property in the [bcp] section of the ocs.cfg file:
[bcp]
CS_BEHAVIOR = CS_BEHAVIOR_100
If CS_BEHAVIOR is not set to CS_BEHAVIOR_100, you can use functionality for bcp 11.1 and later.