Solved

SQL server 2008 Recursive error

Posted on 2014-10-29
1
40 Views
Last Modified: 2015-09-08
Hi Experts,
While running the above query (original) he is getting following error(ROACH CODE ERROR)
(2.)
After modifying the query(modified query1) as follows
he is getting following error(ROACH ERROR log)
(3.)
And finall when we make following change(modified query2)
we do not get an error , but query ran for 12 hrs + without completion .
Could you pls provide solution.
Thanks in adavance.
modified-query1.txt
modified-query2.txt
original-query.txt
ROAC-Code-error.jpg
ROAC-Error-log.jpg
0
Comment
Question by:Sandeepiii
[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
1 Comment
 
LVL 13

Accepted Solution

by:
Koen Van Wielink earned 500 total points
ID: 40412935
The error you're getting indicates there's something not right with your recursion, and it's stuck in an infinite loop. The second modification disables the maximum number of recursions SQL would normally allow, but since it's still an infinite query it keeps running until you termintate it manually.
It's hard to determine what is wrong with your query without sample data, table structures and an example of your expected output. Please post some sample data and a sample of your desired output.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server 2012 r2 and SQL 2014 6 33
SQL Percentage Formula 7 30
When are cursors useful? 8 55
T-SQL: Number of Records is Greater Than One 7 42
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

738 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