Internal query processor error: Query processor encountered an unexpected error during execution

Source: Internet
Author: User

The official explanation is as follows. I haven't figured out why. I didn't execute two identical select into statements as described below. I still reported this error, and after I changed it using the first method, I only passed the test for the first time, and this problem occurs later. Then I changed it to the second method and tested it several times. So far, no error has been reported. In addition, I use JDBC to execute SQL statements. I place the first and second SQL statements (original SQL statements) that are not used in the SQL server's built-in query analyzer for execution, is not reported this error, please give pointers to the 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 test2goselect * into test2.. T2 from test1.. T1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.