内部查询处理器错误: 查询处理器在执行过程中遇到意外错误

官方解释如下,我到现在都还没有搞清楚是为什么,我没有像下面所讲的那样执行两个同样的SELECT INTO语句,还是报这个错,而且我用第一种方法改了过后,只有第一次测试通过了,后面又出现这个问题,后来换成第二种方式,测试了几遍,到目前为止,还没有出现错误。另外,我是用JDBC来执行的SQL语句,我把没有使用第一种和第二种的SQL语句(原始SQL)放到SQL SERVER自带的查询分析器里面执行, 是不会报这个错的,请高手指点一下http://support.microsoft.com/kb/323586/en-us

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.

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
					

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值