BCP_SETL

DB Library for C

DB Library for C

BCP_SETL

Sets the LOGINREC to enable bulk-copy operations.

Syntax

RETCODE BCP_SETL ( PLOGINREC loginrec,
BOOL enable );

Arguments

loginrec

Is a pointer to a LOGINREC structure, which is passed as a parameter to dbopen. You can get a LOGINREC structure by calling dblogin.

enable

Is a Boolean value (TRUE or FALSE) that specifies whether to enable bulk copy operations for the resulting DBPROCESS. By default, DBPROCESS structures are not enabled for bulk-copy operations.

Returns

SUCCEED or FAIL.

Remarks

This function sets a field in the LOGINREC structure that tells Microsoft® SQL Server™ 2000 that the DBPROCESS connection can be used for bulk-copy operations. For it to have any effect, it must be called before dbopen, the function that actually allocates the DBPROCESS structure.

In applications that allow users to make ad hoc queries, you may want to avoid calling this function to keep users from initiating a bulk-copy sequence with Transact-SQL statements. Or you may want to call it with the enable parameter set to FALSE. After a bulk-copy sequence has begun, it cannot be stopped with a Transact-SQL statement.

See Also

bcp_init

dbsetlhost

dblogin

dbsetlpwd

dbopen

dbsetluser

dbsetlapp