Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Error message during deletion Expand / Collapse
Author
Message
Posted Tuesday, May 7, 2013 3:21 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, July 25, 2014 4:16 PM
Points: 50, Visits: 221
Hi All,

I am trying to delete a record from a table using a stored procedure.While executing the SP i am getting the below error.

"The query processor ran out of stack space during query optimization. Please simplify the query."

What could be the reason?

Please help
Post #1450037
Posted Tuesday, May 7, 2013 5:09 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 6:36 PM
Points: 1,886, Visits: 18,565
kk.86manu (5/7/2013)
Hi All,

I am trying to delete a record from a table using a stored procedure.While executing the SP i am getting the below error.

"The query processor ran out of stack space during query optimization. Please simplify the query."

What could be the reason?

Please help


please post details of your proc
ddl for the table you are deleting from, including indexes and FKs
number of rows in table


__________________________________________________________________
you can lead a user to data....but you cannot make them think !
__________________________________________________________________
Post #1450063
Posted Tuesday, May 7, 2013 6:46 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: 2 days ago @ 1:21 PM
Points: 809, Visits: 1,160
What version of SQL Server you are in?
It is a known issue SQL Server 2005 SP2. There is a ptch out to fix this issue.
But if you are in some other version. you have to look back at the code to see what you can optimize. Because What I believe that you have a very -2 complex and big stored proc which is trying to delete something.

Divide your sql's into small statements, use temp tables to store intermediate data etc..
Post #1450102
Posted Wednesday, May 8, 2013 7:18 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, July 25, 2014 4:16 PM
Points: 50, Visits: 221
Hi Livingston,

The procedure is a simple delete statement on a table based on ID column and the total number of rows is 25.

Table in which i am trying to delete is referenced by foreign key(6 foreign key references).

Please let me know if this is causing the issue.If that is the case how to overcome.

Kindly let know your views.
Post #1450547
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse