1FreeTDS(November 27, 2004) FreeTDS(November 27, 2004)
2
3
4
6 freebcp - bulk loading utility for Sybase and Microsoft databases
7
9 freebcp [database.[owner].]table_name {in | out} datafile
10 { -c | -n | -f formatfile }
11 [-b batchsize] [-F firstrow] [-L lastrow] [-e errfile]
12 [-I interfaces_file] [-m maxerrors] [-t field_term] [-r row_term]
13 [-S servername] [-U username] [-P password]
14
16 freebcp is a utility program distributed with FreeTDS. freebcp repli‐
17 cates (in part at least) the functionality of the "bcp" utility pro‐
18 grams distributed by Sybase and Microsoft.
19
20 freebcp makes use of the dblib bcp api built into FreeTDS. This api is
21 also available to application developers.
22
23 The manual pages or online help for Sybase or SQL Server can be refer‐
24 enced for more detailed information on "bcp" functionality.
25
27 database
28 is optional if the table being copied is in your default data‐
29 base or in master. Otherwise, you must specify a database name.
30
31 owner is optional if you or the database owner are the owner of the
32 table being copied.
33
34 table_name
35 is the name of the database table you wish to access.
36
37 in | out
38 is the direction of the bulk copy operation. file into a data‐
39 base table, 'out' indicates that data is being copied from a
40 database table to a host file.
41
42 datafile
43 is the full path name of an operating system file.
44
46 -c specifies that the host data file is in 'character' format.
47 Briefly, this means the following: that all data in the file is
48 (or will be written) in ASCII; that the (tab) is the default
49 field terminator; that (newline) is the default row terminator.
50
51 -n specifies that the host data file is in 'native' format. This
52 is a format that freebcp will be able to process, but is not
53 portable or readable.
54
55 -f formatfile
56 specifies that the format of the host data file is described by
57 the specified formatfile. The format of formatfile is identical
58 to that understood by Sybase or MS bcp, but is too complicated
59 to describe here.
60
61 -b batchsize
62 is the number of rows per batch of data copied. Batching applies
63 only when you are bulk copying into the database. each batch of
64 data is effectively 'committed' into the database. the default
65 value for batchsize is 1000.
66
67 -F firstrow
68 is the number of the first row to copy from the input file or
69 database table the default is the first row.
70
71 -L lastrow
72 is the number of the last row to copy from an input file or
73 database table the default is the last row.
74
75 -r row_term
76 specifies the row terminator. Default is newline ('\n')
77
78 -t field_term
79 specifies the field terminator. Default is tab ('\t')
80
81 -S servername
82 specifies the name of the Database Server to which to connect.
83
84 -U username
85 specifies a database login name.
86
87 -P password
88 specifies a database password.
89
91 To date, freebcp has been tested against Sybase ASE 11, and SQL Server
92 2000. There are currently a number of restrictions on its use.
93
94 When connecting to a Sybase database server, it is required that the
95 TDS 5.0 protocol be used. When connecting to a Microsoft SQL Server
96 2000 database server, the TDS 8.0 protocol is required.
97
98 Theoretically both Sybase and Microsoft support the TDS 4.2 protocol,
99 but in reality they implement the bcp portion of TDS 4.2 differently.
100 Freetds has no way of knowing which type of server it's connected to,
101 hence TDS protocol 4.2 is not supported.
102
104 freebcp first appeared in FreeTDS 0.60
105
107 The freebcp utility was written by Bill Thompson (thomp‐
108 bil@exchange.uk.ml.com)
109
111 Currently, there is no support for text data types in freebcp, when SQL
112 Server 2000 is the target database.
113
114 The following parameters are accepted but unimplemented
115
116 [-e errfile]
117
118 [-I interfaces_file]
119
120 [-m maxerrors]
121
122
123
124 0.63RC1 FreeTDS(November 27, 2004)