Error 268

Severity

16

Message text

You can't run SELECT INTO in this database. Please check with the Database Owner.

Explanation

This error occurs when you try to add rows to a table using the select into clause in a database that has the sp_dboption option select into/bulkcopy parameter disabled.

If this error occurs when you try to select into a temporary table, or while running a Sybase-supplied stored procedure, it is likely that the select into/bulkcopy option is not enabled in tempdb. Some stored procedures, for example, sp_help and sp_helpsort, trigger this error because they select into temporary tables (that all belong to tempdb) to get reports from the system tables, and to update them. If tempdb does not have the sp_dboption option select into/bulkcopy enabled, error 268 occurs.

NoteWhen you install Adaptive Server, the select into/bulkcopy option is enabled in tempdb and turned “off” in all other databases.

You must enable the sp_dboption option select into/bulkcopy to perform nonlogged operations. For example:

Action

Ask the System Administrator (“sa”) or database owner (“dbo”) to enable the sp_dboption option select into/bulkcopy for all databases affected by the query (including tempdb if applicable). The “sa” or “dbo” can use this procedure:

  1. Use the master database and change the option:

    1> use master 
    2> go
    
    1> sp_dboption <database_name>, 
    2> "select into/bulkcopy", true 
    3> go
    
    1> use <database_name> 
    2> go
    
    1> checkpoint 
    2> go
    
  2. To verify that the change is active, use sp_helpdb:

    1> sp_helpdb <database_name> 
    2> go
    

    In the output, the phrase select into/bulkcopy should appear, indicating that the option is enabled.

    WARNING! Dump your database before disabling the select into/bulkcopy option. If you insert nonlogged data (via a nonlogged operation) into the database, you will not be able to dump the transaction log to a device, and will not be able to recover your data.

By default, the select into/bulkcopy option is disabled when a database is first created. To change this default, use the procedure above to allow the option in the model database.

Additional information

If a table has indexes or triggers, then bcp will not run in the fast mode, so you do not need to set the select into/bulkcopy option to run bcp.

You cannot dump the transaction log to a device after performing a minimally logged operation. Trying to dump the transaction log after a minimally logged operation causes error messages that instruct you to dump the database instead.

Versions in which this error is raised

All versions