Error 4806

Severity

16

Message text

You cannot run the non-logged version of bulk copy in this database. Please check with the DBO.

Explanation

This error occurs when the select/into bulkcopy option is set to “false” and you use “fast” bulk copy into a table that has no indexes.

NoteIn newly created databases, the select into/bulkcopy option is set (by default) to the same as that in model.

Action

Use the following options to recover from this error.


Turn on select into/bulkcopy (all versions)

Use the sp_dboption stored procedure to set the select into/bulkcopy option to “true”:

1> sp_dboption <database_name>, 
2> "select into/bulkcopy", true
3> go
1> use <database_name> 
2> go
1> checkpoint
2> go

Once a minimally logged operation such as “fast” bulk copy runs in the database, you cannot dump the transaction log to a device, because unlogged changes are not recoverable. Instead, perform a dump database as soon as possible to restore recoverability and allow transaction dumps to devices again.


Create an index for the table

Put an index on the table into which you are trying to copy. This causes inserts to be logged.

When you copy into a table that has indexes, a slower version of bcp is automatically used. The slow version, which does log data inserts in the transaction log, can cause the transaction log to become very large. You may need to use dump transaction with truncate_only until you can perform a full database dump. If you must do this, you will lose the ability to recover up-to-the-minute changes in data in case of a media failure. Also consider using smaller bcp batch sizes by adding the -b parameter to avoid a large size transaction log.

Versions in which this error is raised

All versions