Solved

[SQLSTATE 42000] (Error 8630)."

Posted on 2010-09-08
7
2,108 Views
Last Modified: 2012-05-10
Hi all -

I am running (hypothetically) a stored procedure. When I run it out of the query window in ssms it runs just fine. When I put it into a job and execute it, it will run for a while and then I get :

Internal Query Processor Error: The query processor encountered an unexpected error during execution. [SQLSTATE 42000] (Error 8630).

SQL version is Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)   Mar 29 2009 10:11:52   Copyright (c) 1988-2008 Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )

I've ran dbcc and everything checks out ok. I can execute other jobs just fine on the server and they run successfully. Help?
0
Comment
Question by:rmm2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 29

Expert Comment

by:QPR
ID: 33632830
does the Sp call any other objects during execution (functions, views, other stored procedures)?
If so, does the acount running the job have the necessary permissions to access these objects?
Does the job write to the file system or access a linked server?
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 33632845
Check whether you have a SELECT INTO statement in your procedure:

http://support.microsoft.com/kb/323586

Are you sure that you have applied SP1 for SQL Server 2008, if not then apply SP1 and try.

Also try checking ways to tune your procedure to get rid of SELECT INTO logic or any other complex statements.
0
 
LVL 7

Author Comment

by:rmm2001
ID: 33632860
the main sp calls a sub sp. and it works fine for a while and then just dies so it definitely has the permissions that it needs. and no on the linked server/file system object
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 7

Author Comment

by:rmm2001
ID: 33632879
No select into's. Just insert into's. And yes on the SP1. This is what it gives me :  Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)   Mar 29 2009 10:11:52   Copyright (c) 1988-2008 Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 33634021
>> the main sp calls a sub sp. and it works fine for a while and then just dies so it definitely has the permissions that it needs

Does the execution of main SP works successfully when executed in SSMS.
Kindly let me know how much time it takes for the main SP to execute successfully.

If it takes more time, then we need to think of tuning the procedure.
0
 
LVL 7

Accepted Solution

by:
rmm2001 earned 0 total points
ID: 33684754
Sorry for the long delay. I've been trying various things. The procedure which this was happening on runs for 23-24 hours. And that's just how long it has to take. It handles a lot of data and we've tuned the best we can there. What ended up happening is that we started to process things in 10k chunks (not 5k because that produced the same error). So it's up and running now - I just don't know the explanation behind it all.

I want to thank you all for your input!
0
 
LVL 7

Author Closing Comment

by:rmm2001
ID: 33684798
Sorry for the long delay. I've been trying various things. The procedure which this was happening on runs for 23-24 hours. And that's just how long it has to take. It handles a lot of data and we've tuned the best we can there. What ended up happening is that we started to process things in 10k chunks (not 5k because that produced the same error). So it's up and running now - I just don't know the explanation behind it all.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

742 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question