Transferring tables from a destination file

Use the transfer table command to load data into Adaptive Server from a table contained in an external file. See the Reference Manual: Commands.

NoteAdaptive Server version 15.5 must use its internal format to import tables.

The table you are loading does not require a unique primary index, unless you are loading data that has changed from data already in the table (you can load new data without any restrictions). However, loading data becomes an issue when a row duplicates data already in the table, and you do not want the data duplicated. To prevent this, a unique primary index allows Adaptive Server to find and remove the old row the new row replaces.

The table you are loading must have a unique index as its primary key (either a clustered index for allpages-locked tables, or a placement index for data-only-locked tables). A unique index allows transfer to detect attempts to insert a duplicate key, and converts the internal insert command to an update command. Without that index, Adaptive Server cannot detect duplicate primary keys. Inserting an updated row causes:

This example transfers the pubs2.titles table from the external titles.tmp file located in /sybase/data into Adaptive Server:

transfer table titles from '/sybase/data/titles.tmp' for ase

You cannot use all the parameters for the transfer table...from that you use with transfer table. . .to. Parameters that are inappropriate for loading data from a file produce errors and the transfer command stops. Adaptive Server version 15.5 includes parameters for the from parameter that are reserved for future use, but transfer ignores these parameters if you include them with your syntax. The parameters for the from parameter are: