Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Table goes in infinite loop

Posted on by 170

Hi everyone,

while i am trying to run a table, but table not showing records and getting in infinite loop.

even when i am trying to retrieve data from table through SQL query, query not getting finished, it is also going to infinite loop. 

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Table goes in infinite loop

    Hi Sunil,

    As Vishal said you might be checking in some other company.

    I would suggest you to check to 5000 records in query. This will help you to analyse whether you are executing query in correct company or not.

    Regards,

    Neeraj Singh

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Table goes in infinite loop

    I think, you are not checking the right NAV table in SQL. There must be some company holding lot of records in the tables and hence it is taking longer time.

    Check this query.

    select Count(*) from [tablename] and see the No. of Records in this particular table. There might be multiple companies in the NAV and might be misleading you in terms of number of records.

  • Verified answer
    Alexander Ermakov Profile Picture
    Alexander Ermakov 28,094 on at
    RE: Table goes in infinite loop

    4k records is nothing for sql. Theoretically, there might be a problem with one certain record. You can troubleshoot to find it. Select top 100 rows. If it does not go well, then select top 50. If it works fine, then potential problematic record is between 50 and 100. Select top 75 then, etc. divide you range in two unless you shorten your range to few records. I guess you have got the idea.

    If you manage to identify a problematic record, analyze it. Look at what is written in the fields, perhaps you will find some wierd data...

  • Sunil1991 Profile Picture
    Sunil1991 170 on at
    RE: Table goes in infinite loop

    Because when i am applying the below query, it's continueslly running and every time i have to stop it manually. it's not getting completed and result showing more than 35-40 lacs. but in actual total records are 3500-4000 only.

  • Sunil1991 Profile Picture
    Sunil1991 170 on at
    RE: Table goes in infinite loop

    Hi, RockWith i have apply this query, it's working fine.

    but, when i am applying the below query, it goes in infinite loop and running continuously.

    there are only 3500-4000 records in table.

    select * from [tablename]

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at
    RE: Table goes in infinite loop

    I too have the same Question what Alex asked.

    Apply this Query

    Select TOP 1 * from [TABLENAME] WITH (NOLOCK)

  • Alex Chow Profile Picture
    Alex Chow 4,481 on at
    RE: Table goes in infinite loop

    How do you know that it's going into an infinite loop?

  • Suggested answer
    Alexander Ermakov Profile Picture
    Alexander Ermakov 28,094 on at
    RE: Table goes in infinite loop

    How many records does this table have? What are exactly the customized fields and what are the logic behind them?

  • Sunil1991 Profile Picture
    Sunil1991 170 on at
    RE: Table goes in infinite loop

    Yes, if i am trying to retrieve the filtered record from this table by SQL query, it's working.

    but when trying to retrieve all record it's getting stuck.

    Table is "Purchase Line", and there are some customized fields in this table.

  • Suggested answer
    Binesh Profile Picture
    Binesh 7,885 on at
    RE: Table goes in infinite loop

    Hello Sunil,

    Use bellow command in SQL query and Replace the DB Name, Company Name, Table Name as per your Table.

    /****** Script for Select Top 1st Row command from SSMS ******/
    SELECT TOP 1 * FROM [Demo Database NAV (7-0)].[dbo].[CRONUS Canada, Inc_$Customer]

    After execution of this command what you get, let me know.

    For better response mention clearly Like: Table ID, [Customize or Standard or Add-ons].

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans