Adaptive Server Utility Guide

Read about updates, corrections, and clarifications for Adaptive Server Utility Guide.

bcp

Support for initialization strings

The bcp utility supports sending Transact-SQL commands, such as set replication off, to Adaptive Server before data is transferred.

Although you can use any Transact-SQL™ command as an initialization string for bcp, you must reset possible permanent changes to the server configuration after running bcp. You can, for example, reset changes in a separate isql session.

Syntax changes

The following bcp parameter supports Transact-SQL initialization commands:
-- initstring 'Transact-SQL command'

Result sets issued by the initialization string are silently ignored, unless an error occurs.

Example

In this example, replication is disabled when titles.txt data is transferred into the pubs2..titles table:

bcp pubs2..titles in titles.txt –-initstring 'set replication off'

In this example, set replication off is limited to the current session in Adaptive Server; you need not explicitly reset the configuration option after bcp is finished.

Note: If Adaptive Server returns an error; bcp stops the data transfer and displays an error message.