Copy In Data with a Format File

To copy data back into Adaptive Server using the saved pub_fmt format file, run:

bcp pubs2..publishers in pub_out -fpub_fmt

Use the pub_fmt file to copy any data with the same format into Adaptive Server. If you have a similar data file with different delimiters, change the delimiters in the format file.

Similarly, edit the format file to reflect any changes to the field lengths, as long as all fields have the same length. For example, the moresales file contains:

804213-L-9 Jan 21 1993 12:00AM
804255-N-8 Mar 12 1993 12:00AM
804291-T-4 Mar 23 1993 12:00AM
804291-W-9 Mar 23 1993 12:00AM

Edit the sal_fmt format file to read:

10.0
3
1    SYBCHAR 0 4 "" 1 stor_id
2    SYBCHAR 0 7 "" 2 ord_num
3    SYBCHAR 0 21 "\n" 3 date

Then enter:

The system responds:

Starting copy...
4 rows copied.
 Clock Time (ms.): total = 1 Avg = 0 (116000.00 rows 
per sec.)