A wrapper for a system call to the bcp utility which writes a SQL Server table or query (T-SQL) to a file.
Arguments
- file
- output file name 
- connectargs
- named list of connection arguments. See makeConnectArgs. 
- table
- name of the source table when exporting from SQL Server 
- query
- Transact-SQL query that returns a result set. Ignored if table is specified. 
- fieldterminator
- character separator for columns 
- rowterminator
- character separator for rows--new lines 
- bcpOptions
- list of additional options to pass to the - bcputility. See details.
- ...
- arguments to pass system2 
Details
The bcpOptions allows the user to include additional arguments for the
call to system2. Please refer to
https://learn.microsoft.com/en-us/sql/tools/bcp-utility.
The default options are set
to the defaults for bcp CLI. -b refers to
number of rows to write at a time; 10,000 to 50,000 is a
starting recommendation. -a refers to size of packets to be sent in
bytes. -e refers to the maximum number of errors before failure.
