Internal Query Processor Error:

  • HAs anyone seen this error:

    "Internal Query Processor Error: The query processor encountered an unexpected error during execution."

    All I'm doing is creating dynamic sql statement as follows to do selct into's:

    SET @command = N'SELECT * INTO GRD_RESTORE_INFO..MenuItem FROM ' + @DatabaseName + '..MenuItem'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..MenuItemVersion FROM ' + @DatabaseName + '..MenuItemVersion'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..UserRoleMenuItem FROM ' + @DatabaseName + '..UserRoleMenuItem'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..AnalystMenuItem FROM ' + @DatabaseName + '..AnalystMenuItem'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..WorkflowServer FROM ' + @DatabaseName + '..WorkflowServer'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..WorkflowServerClientMachine FROM ' + @DatabaseName + '..WorkflowServerClientMachine'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..DatabaseSite FROM ' + @DatabaseName + '..DatabaseSite' + CHAR(10)

    IF @DisplayCmds = 1

    BEGIN

    PRINT ' Command: ' + @Command

    PRINT ''

    PRINT ''

    END

    EXECUTE SP_EXECUTESQL @Command

    The above error occurs. Anyone have any ideas?

  • Hi,

    Have a look at this KB:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;323586

    /fredrik

  • ALready seen this but doen't seem to resolve my issue

  • BOL 2000: Select statement

    INTO Clause

    Creates a new table and inserts the resulting rows from the query into it.

    After the successfull execution of the first SELECT INTO, the second select should throw an error!

    Can try a UNION ALL with an INTO on the first select. Haven't tried it myself yet.

  • I haven't seen it before, but, based on the MS article, I would try this:

    SET @command = N'SELECT * INTO GRD_RESTORE_INFO..MenuItem FROM ' + @DatabaseName + '..MenuItem option (keep plan)'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..MenuItemVersion FROM ' + @DatabaseName + '..MenuItemVersion option (keep plan)'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..UserRoleMenuItem FROM ' + @DatabaseName + '..UserRoleMenuItem option (keep plan)'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..AnalystMenuItem FROM ' + @DatabaseName + '..AnalystMenuItem option (keep plan)'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..WorkflowServer FROM ' + @DatabaseName + '..WorkflowServer option (keep plan)'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..WorkflowServerClientMachine FROM ' + @DatabaseName + '..WorkflowServerClientMachine option (keep plan)'

    + CHAR(13) + ' SELECT * INTO GRD_RESTORE_INFO..DatabaseSite FROM ' + @DatabaseName + '..DatabaseSite option (keep plan)'

    IF @DisplayCmds = 1

    BEGIN

    PRINT ' Command: ' + @Command

    PRINT ''

    PRINT ''

    END

    EXECUTE SP_EXECUTESQL @Command

    and see what the result is. If it gets rid of the issue, then it is related to the cited issue.

  • Sorry, I misread the SQL statement

  • I tried that with the option plan statement at the end of end line but it worked the first time and thereafter I got the same error message.

  • Sometimes i get the same error message in Enterprise Manager when I click with the right button on a table and select "Open table --> Return all rows"...

  • What version and patch level are you running of SQL?

  • SQL 7.0 SP 3

    NT 4.0 SP6

  • Do they all need to go and all need to fail together and have you tried them in seperate calls to see if the problem is retained then?

  • They could go as separate calls but there should be no reason why this statement doesn't work

  • I understand that. Just want to see if the behavior is the same or not. I am not able to dup so just want to see if the code is the issue or the server?

  • will give it a go and let you know

  • Just a quick question: Is the behavior different if you do not use SP_EXECUTESQL, e.g.:

    EXECUTE (@Command)

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic. Login to reply