.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Infinite loop detected. The loop dependency is 3 -> 3.

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :Sql Server


I've run into the problem described in the title. I've created a dummy Benchmark dimensionw with a couple of members using a named query (Me, Competitors). In my calculation script I've got the following MDX:

[Benchmark].[Benchmark].&[Me] = [Company].[Organisation].CurrentMember;
[Benchmark].[Benchmark].&[Competitors] = 

The reason for this being that I would like [Company].[Organisation] as a background selection and I'd like the Benchmark members as the series.

Now when I run the following MDX statement

HIERARCHIZE( { DESCENDANTS( [Date].[Year - Quarter - Month - Day].[Year].&[2009], [Date].[Year - Quarter - Month - Day].[Month] ) } )
HIERARCHIZE( { [Benchmark].[Benchmark].&[Competitors], [Benchmark].[Benchmark].&[Me] } )
FROM [Cube]
WHERE ( [Company].[Organisation].[Key].&[036], [Measures].[My Measure] )

I would expect it to return the average number for the competitors and the number for me - but this is not the case. I get the correct value for [Me] but i get an infinite loop error for the competitors and t

View Complete Post

More Related Resource Links

Error message "Infinite recursion detected. The loop of dependencies is: ." but I have no recursion?



I have a query like

   MEMBER [Product].[AttribE].[grp6] AS
      Aggregate( { [Product].[AttribE].&[a], [Product].[AttribE].&[b], [Product].[AttribE].&[c], [Product].[AttribE].&[d], [Product].[AttribE].&[e] } )
      ,Caption = 'Some text'
   MEMBER [Product].[AttribE].[grp0] AS
      Aggregate(( [Product].[AttribE].[AttribE].Members - { [Product].[AttribE].&[a], [Product].[AttribE].&[b], [Product].[AttribE].&[c], [Product].[AttribE].&[d], [Product].[AttribE].&[e] } ))
      ,Caption = 'All Others'
    ([Measures].[m], [Period].[Year-Six-Qtr].[Qtr].&[200903], [Statistic].[Statistic].&[none]),
    ([Measures].[m], [Period].[Year-Six-Qtr].[Qtr].&[200906], [Statistic].[Statistic].&[none]),
    ([Measures].[m], [Period].[Year-Six-Qtr].[Qtr].&[200909], [Statistic].[Statistic].&[none]),
    ([Measures].[m], [Period].[Year-Six-Qtr].[Qtr].&[200912], [Statistic].[Statistic].&[none]),
    ([Measures].[m], [Period].[Year-Six-Qtr].[Qtr].&[201003], [Statistic].[Statistic].&[none]),
    ([Measures].[m], [Period].[Year-Six-Qtr].[Qtr].&[201006], [Statistic].[Statistic].&[none])
    ({ ([Product].[AttribA].&[A], [Product].[AttribB].&[B1], [Product].[AttribC].&[C], [Product].[AttribD].&[D1]) } * ( { [Product]

Whats the reason for this infinite loop?

hi friends, i have the following fucntion that tokenize a CSV string and return a table of values create function fn_get_int_table_frm_csv ( @csv_values nvarchar(max) ) returns @indexes table (idx int identity(1, 1) primary key, Role_id int) as begin declare @ret nvarchar(max) declare @comma_pos int declare @token nvarchar(max) set @ret = @csv_values while len(@ret) > 0 begin if( len(@ret) <> 1 ) begin -- gets the first occurance of the "comma" in the @ret set @comma_pos = charindex(',', @ret); -- gets the first values that was seperated in the string set @token = substring( @ret, 1, @comma_pos - 1 ) -- add that to the return table insert into @indexes values ( convert(int, @token) ) -- set a new starting position set @comma_pos = @comma_pos + 1 -- Tokenize the string from the new starting position set @ret = substring( @ret, @comma_pos, len(@ret) - (@comma_pos - 1) ) end else begin set @token = @ret -- add that to the return table insert into @indexes values ( convert(int, @token) ) end end return end go when i execute this by passing '1,2,3,4' the argument, it goes to an infinite loop, how do i fix it? thanks

Approval workflow with moderation enabled goes to infinite loop


We are using WSS 3.0 and custom approval workflow from the SDK. The workflow is configured on a document library with the Moderation enabled. The workflow is set to trigger on item edit and new item creation.

The workflow works fine, sometimes goes into infinite loop. I know this was a known issue/bug with approval workflow and there was a patch released for this - KB 955586

We have WSS 3.0 SP 2 and i assume the above patch is included in the SP 2.

We are still facing the issue, should i explicitly install the above patch? What is the workaround for this issue?

Any help is highly appreciated.



Merge Replication Infinite Loop & Time Problem


Hi all,

We have merge replication system between Sql Server 2008 R2 64bit Enterprise Edition (As a Publisher&Distributor) and Sql Server 2008 R2 Express Edition (As 800+ Subscribers). We use only "https " method as transfer method. We have 30 tables and we have Joins & Filters. Our system work normally for 5-6 months.

But for last 10 days, sometimes (generally initial snapshot being downloaded), it takes over 14 hours to replicate!! I think an infinite loop is being occured during the process. I trace the publication server with Sql Server Profiler 2008 and here is the trace file.

Lots of times, i see this line "exec sp_MSmergeupdatelastsyncinfo '8C01EA1F-153D-47BC-ACD3-F8439ACB7B76',2,N'Merge completed with no data changes processed .'" (and also other lines which repeat similar to this one) with same/different  Session ID's. And when i first see this line is after 3 seconds the start time of the Process!! And after , 6 seconds again same line, and after 13 seconds again same line and it goes on like this. I think, in fact synchronization process is finished after 5-6 seconds (normally because there is no any data change in fact!) but for some reason, it continues to same process over and over.

Is this a bug or anything else, h

Microsoft's Collaborative Application Markup Language (CAML) Loop

discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

for each loop



Need help in for each loop. i'm poor in for each loop. i wanna create a for each loop that can give me 2 value in each rows.

i create a for loop.. but is a mulitple rows. Anyone can help ?

here is my code.

Dim x As Integer, y As Double, x1 As Integer

        Dim d As Date, prevD As Date
        Dim d1 As TimeSpan

        temp_sec = ac.getTempTime(ddl_date.SelectedValue, ddl_id.SelectedValue)

        For I As Int32 = 0 To temp_sec.Tables(0).Rows.Count - 1
            If I Mod 1 = 0 Then
                ' To prevent list out of bounds
                If I + 1 < temp_sec.Tables(0).Rows.Count Then
                    d = temp_sec.Tables(0).Rows(I).Item(0)
                    prevD = temp_sec.Tables(0).Rows(I + 1).Item(0)
                    d1 = prevD - d
                    x = d1.TotalSeconds
                    x = x1 + x
                    y = temp_sec.Tables(0).Rows(I).Item(1)
                    list.Add(x, y)
                    x1 = x
                End If
            End If

Loop for every record


Hi guys.

I've got a simple table with an ID, a NAME and an ARCHIVE booleen.

I want to write piece of code that goes through each record and...

If ARCHIVE is false and a folder hasn't been created for it, it will create it and go to the next record.

If ARCHIVE is false and a folder has been created for it, it will do nothing and go to the next record.

If ARCHIVE is true the whole folder will be moved to another folder and go to the next record.

When all records have been checked, the code will end.

I was thinking of using a SQL count to find out how many records there were and making a loop that starts at record one. runs the folder checking/creating/archiving code then +1 until the loop ends but I couldn't work out how to assign the query results to an integer...

I'm not asking for anyone to write the code. I think I probably already know 80% of the theory behind doing this I just can't glue it all together. I know you can do the folder stuff with the System.IO Directory Class...

Anyway, all input is welcome. Cheers guys!


Loop with DataReader


Hi.  I am having a really hard time with this code trying to loop through a datareader, and then enter the data into another table.  The logic is that I get 2 columns path and document_no from an Oracle Database.  I then need to check if the file in the path column is a valid path.  If it is not valid, it should be inserted into a SQL Server 2005 database.  My code is below, can anyone help?  I'm getting a headache from it.  If any further info is needed just let me know.  Thanks. 

Do While oraReader.Read()
                path1 = oraReader("Path")
                docno = oraReader("Document_No")
                If (System.IO.File.Exists(path1)) Then                    
                    sqlCmd = New SqlCommand("INSERT INTO CHECKLINKS1 (DOCUMENT_NO) VALUES (@doc)", conn)
                    sqlCmd.Parameters.AddWithValue("@doc", docno)
                End If


how to get current loop order number in "for each" ?

For Each item As pages.tbl1Row In pagesdim x as integerx = ?????response.write("current loop is :" & x )               Nextwhat code i need to replace with "?????" to get current loop order?


I'm currently experiencing a spinloop wait type with command of Unknown Token. The issue occured when I copied DB filed from another server and attempted to attach it -using the SSMS wizard - to the affected DB. The attach failed due to an OS permission error but the database engine - for no clear reason - mounted the DB in a Recovery/Read Only mode; the transaction did not rollback. This rogue DB cannot be altered, dropped, detached, etc and KILL command fails against the culprit SPID. In the DB log there is a stack dump at Location:  "logmgr.cpp":5527, * Expression:  !(minLSN.m_fSeqNo < lfcb->lfcb_fSeqNo). And the errors: Error: 17066, Severity: 16, State: 1; Error: 3624, Severity: 20, State: 1. The logs continue thereafter with the following: Process 29:0:0 (0xe48) Worker 0x0000000015D6E1C0 appears to be non-yielding on Scheduler 18. Thread creation time: 12927361417467. Approx Thread CPU Used: kernel 46 ms, user 4040 ms. Process Utilization 7%. System Idle 88%. Interval: 132567 ms. I also discovered that sql server agent will not run jobs although the serive is running. Its logs read: 2010-08-27 08:36:26 - ? [393] Waiting for SQL Server to recover databases... 2010-08-27 10:41:59 - ? [131] SQLSERVERAGENT service stopping due to a stop request from a user, process, or the OS... 2010-08-27 10:42:00 - ? [098] SQLServerAgent term

Serialization error in a for each loop

I have a for each loop in a 3.5 workflow. This takes a list if criteria to build a query string to call a Secure Webservive necesitating the use of a certificate. I load the certificate further up stream and pass it as a dependency property. The process returns a serialization error for the certificate. How do I avoid this error?  Thanks!

get out parameter in asp.net in multiple While loop of sql

Hello Expert, I am working on asp.net 3.5 . I have 1 problem. I made 1 SP in which I used 3 While Loop. 1 for year , 1 for month and 1 for Week Week loop is inside year and month and in week loop I set 1 Out Parameter. When I  exicute stored procedure I got Out Parameter value as 1 . but in front end I get Out parameter value as null which is actualy 1 (value of output parameter) in sql.          

Error on 23rd Loop of Foreach

Hi, I have a MAster Package callling 8 Dimension Package and 5 fact table packages. Fact table Packages are in for eachloop. They have to loop 24 times during FirstRun Each fact table load more than 500000 rows in every loop, and out of 5, two package loads more than million rows in every loop. I got the following error message when the package was looping for the 23rd time. One of the five Fact table package failed with following error DTS primeoutput failed returned error code 0xC02020C4 SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Staging Table "(1) returned error code 0xC02020C4. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure. After when I ran package explicitly, it ran well Please help on what to be done to avoid this error and what does this error mean?. I am Using SQL Server 2008, i5 Processor, 3.42GB RAm, DefaultBufferMaxRows = 10000 and Default BufferSize 10MB, EngineTHread=10 Thanks, Anuja

Endless update loop after return of customDataSet in UpdateHandler

I have created a custom conflict handler for merge replication that responds to Inserts and Updates from both the Publisher and the Subscriber.  This is a prototype so the tables involved are limited. Unfortuntely, I get into an endless loop of updates back and forth. I respond to the Inserts and Updates because the SiteIndex of sites in the tblSites table are different on the two replication databases but their SiteID is the same.  When transferring records from the tblGroups table, I need to look up the SiteIndex and translate it to the right value for the target (Publisher vs. Subscriber).  Here’s the code for the Update:   public override ActionOnDataChange UpdateHandler( SourceIdentifier updateSource, DataSet updatedDataSet, ref DataSet customDataSet, ref int historyLogLevel, ref string historyLogMessage ) { int siteIndex = (int)updatedDataSet.Tables[0].Rows[0]["SiteIndex"]; int translatedSiteIndex = 0; if ( updateSource == SourceIdentifier.SourceIsPublisher ) { translatedSiteIndex = TranslateSiteIndex( PublisherSites, SubscriberSites, siteIndex ); } else if ( updateSource == SourceIdentifier.SourceIsSubscriber ) { translatedSiteIndex = TranslateSiteIndex( SubscriberSites, PublisherSites, siteIndex ); } if ( translatedSiteIndex != 0 ) { customDataSet = updatedDataSet.Copy(); customData

Strange for loop problem

Hi, I have this problem with moving a number of documents stored in a SharePoint Document Libray progamatically.The Document library is called "CR" which stores Change Management word documents.  Within this document library there may or may not be a folder which stores attachments (other documents, pictures etc) associated with the CR Document. When a button is pressed this code should see if the CR document has a corresponding folder, and then iterate through each file in that folder and move it to another archive folder.The code I have is as follows:SPList crlist = CR.Web.Lists["CR"]; for (int i = 0; i < crlist.Folders.Count; i++) { if (crlist.Folders[i].Folder.Name == "CR " + CR["CR Number"]) { for (int ii = 0; ii < crlist.Folders[i].Folder.Files.Count; ii++) { crlist.Folders[i].Folder.Files[ii].MoveTo(folderlist.RootFolder.ServerRelativeUrl + "/" + year.ToString() + "/" + WorkflowItem.Title + "/" + crlist.Folders[i].Folder.Files[ii].Name); } } }CR is list item (codument) which this code is working on at the time.crList is the sharepoint docu

For loop to find sum and average

I am trying to write a program that will use the for loop to find the sum, and average of 10 numbers a user enters. I was able to do something like this with out a for loop but I want something a bit more efficient . double num1; double num2; double num3; double num4; double num5; double num6; double num7; double num8; double num9; double num10; Console.Write("Please enter a number: "); num1 = Convert.ToDouble(Console.ReadLine()); Console.Write("Please enter a number: "); num2 = Convert.ToDouble(Console.ReadLine()); Console.Write("Please enter a number: "); num3 = Convert.ToDouble(Console.ReadLine()); Console.Write("Please enter a number: "); num4 = Convert.ToDouble(Console.ReadLine()); Console.Write("Please enter a number: "); num5 = Convert.ToDouble(Console.ReadLine()); Console.Write("Please enter a number: "); num6 = Convert.ToDouble(Console.ReadLine()); Console.Write("Please enter a number: "); num7 = Convert.ToDouble(Console.ReadLine()); Console.Write("Please enter a number: "); num8 = Convert.ToDouble(Console.ReadLine()); Console.Write("Please enter a number: "); num9 = Convert.ToDouble(Console.ReadLine()); Conso

ForEach Loop Container Configuration Question

So here is my question/situation. I have a table that contains a list of all of our servers/instances for my organization. I have a script that I'd like to execute against all of the servers in that list and I was thinking that I should be able to use this container to pull the name/instance from the table, execute the script, store the results in a local table. However, I'm not quite sure on how to attack this meaning not sure which configuration that I would need to use to get me going down the right direction. I've looked around and found alot of documentation on how to enumerate multiple files and folders, but nothing really for what I'm trying to do. Any help or direction would be greatly appreciated.Big Ern
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend