PRB: A SELECT INTO Query May Return the Internal Query Processor Error 8630

Symptoms

A SELECT INTO query may return the following error message

Msg 8630, Level 16, State 77, Line XX Internal Query Processor Error: The query processor encountered an unexpected error during execution.
when all of the following conditions are true:

  • You run the same SELECT INTO query twice and separately.
  • In between the two executions, you perform an operation that causes SQL Server to recompile the second SELECT INTO query.

Workaround

To work around this problem, add the option KEEP PLAN after the second SELECT INTO statement, or change the current database to the target database before you run SELECT INTO statements.

For example, you can add the KEEP PLAN option, or specify the target database before you run the SELECT INTO statement:

Example:

Instead of using the following:
select * into test2..t2 from test1..t1
Change it to either of the following:

select * into test2..t2 from test1..t1 option (keep plan)
-or-

use test2
go
select * into test2..t2 from test1..t1
Propriedades

ID do Artigo: 323586 - Última Revisão: 10 de jul de 2008 - Revisão: 1

Comentários