July 28, 2003 at 5:13 am
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?
July 28, 2003 at 5:45 am
July 28, 2003 at 6:21 am
ALready seen this but doen't seem to resolve my issue
July 28, 2003 at 3:58 pm
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.
July 28, 2003 at 6:16 pm
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.
July 28, 2003 at 7:12 pm
Sorry, I misread the SQL statement
July 29, 2003 at 1:32 am
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.
July 29, 2003 at 1:39 am
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"...
July 29, 2003 at 4:29 am
What version and patch level are you running of SQL?
July 29, 2003 at 4:34 am
SQL 7.0 SP 3
NT 4.0 SP6
July 29, 2003 at 5:02 am
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?
July 29, 2003 at 5:08 am
They could go as separate calls but there should be no reason why this statement doesn't work
July 29, 2003 at 5:12 am
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?
July 29, 2003 at 5:14 am
will give it a go and let you know
July 29, 2003 at 12:08 pm
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