Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

MS Dynamics NAV 2013 - NOLOCK error

Posted on by Microsoft Employee

Hello,

When I try to post sales invoice in MS Dynamics NAV 2013 i get this error:

The following SQL error was unexpected. 
Could not continue scan with NOLOCK due to data movement.



za-forum.png

I figured that with some items i get this error, and with some items i don't.

Can you help me out?
Thanks!

*This post is locked for comments

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at
    RE: MS Dynamics NAV 2013 - NOLOCK error

    Do you remember if you did any changes from SQL side like playing with Isolation level and all??

  • Suggested answer
    Alexander Ermakov Profile Picture
    Alexander Ermakov 28,094 on at
    RE: MS Dynamics NAV 2013 - NOLOCK error

    You have your database corrupted. Before applying DBCC CHECKTABLE with REPAIR_ALLOW_DATA_LOSS (which will probably lead to data loss and should be used as the very final option when nothing else works), try first taking full backup and restoring it back, and running the same DBCC CHECKTABLE - would it give the same results?

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: MS Dynamics NAV 2013 - NOLOCK error

    There’s a problem in that table with that SQL Object id (this is not the NAV id).

    You should check what is the problematic table and execute DBCC CHECKTABLE.

    To have the table name from SQL object ID:

    SELECT name

    FROM sys.objects

    WHERE object_id = @objectid

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: MS Dynamics NAV 2013 - NOLOCK error

    Thank you Stefano,

    I executed DBCC CHECKDB and i got huge log file, and these rows were red:

    Msg 8939, Level 16, State 98, Line 1
    Table error: Object ID 1989582126, index ID 1, partition ID 72057594043432960, alloc unit ID 72057594045071360 (type In-row data), page (1:18386). Test (IS_OFF (BUF_IOERR, pBUF->bstat)) failed. Values are 133129 and -4.
    Msg 8928, Level 16, State 1, Line 1
    Object ID 1989582126, index ID 1, partition ID 72057594043432960, alloc unit ID 72057594045071360 (type In-row data): Page (1:18386) could not be processed.  See other errors for details.
    Msg 8939, Level 16, State 98, Line 1
    Table error: Object ID 1989582126, index ID 1, partition ID 72057594043432960, alloc unit ID 72057594045071360 (type In-row data), page (1:18388). Test (IS_OFF (BUF_IOERR, pBUF->bstat)) failed. Values are 133129 and -4.
    Msg 8928, Level 16, State 1, Line 1
    Object ID 1989582126, index ID 1, partition ID 72057594043432960, alloc unit ID 72057594045071360 (type In-row data): Page (1:18388) could not be processed.  See other errors for details.
    Msg 8978, Level 16, State 1, Line 1
    Table error: Object ID 1989582126, index ID 1, partition ID 72057594043432960, alloc unit ID 72057594045071360 (type In-row data). Page (1:18363) is missing a reference from previous page (1:18386). Possible chain linkage problem.
    Msg 8978, Level 16, State 1, Line 1
    Table error: Object ID 1989582126, index ID 1, partition ID 72057594043432960, alloc unit ID 72057594045071360 (type In-row data). Page (1:18376) is missing a reference from previous page (1:18388). Possible chain linkage problem.
    Msg 8976, Level 16, State 1, Line 1
    Table error: Object ID 1989582126, index ID 1, partition ID 72057594043432960, alloc unit ID 72057594045071360 (type In-row data). Page (1:18386) was not seen in the scan although its parent (1:18356) and previous (1:18358) refer to it. Check any previous errors.
    Msg 8976, Level 16, State 1, Line 1
    Table error: Object ID 1989582126, index ID 1, partition ID 72057594043432960, alloc unit ID 72057594045071360 (type In-row data). Page (1:18388) was not seen in the scan although its parent (1:18356) and previous (1:18365) refer to it. Check any previous errors.
    


    Any ideas?

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: MS Dynamics NAV 2013 - NOLOCK error

    This error has nothing to do with NAV code but it’s triggered by SQL Server when there’s an error reading a data page.

    Try executing DBCC CHECKDB and rebuild your table’s indexes.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: MS Dynamics NAV 2013 - NOLOCK error

    Thanks for quick reply AJ Ansari!

    I did what you said and here are results: 

    5164.forum2.jpg



    PostGLAcc()
      WITH GenJnlLine DO BEGIN
        // G/L entry
        InitGLEntry(
          "Account No.","Amount (LCY)",
          "Source Currency Amount",TRUE,"System-Created Entry");
        IF NOT "System-Created Entry" THEN
          IF "Posting Date" = NORMALDATE("Posting Date") THEN
            GLAcc.TESTFIELD("Direct Posting",TRUE);
        GLEntry."Gen. Posting Type" := "Gen. Posting Type";
        GLEntry."Bal. Account Type" := "Bal. Account Type";
        GLEntry."Bal. Account No." := "Bal. Account No.";
        GLEntry."No. Series" := "Posting No. Series";
        IF "Additional-Currency Posting" =
           "Additional-Currency Posting"::"Additional-Currency Amount Only"
        THEN BEGIN
          GLEntry."Additional-Currency Amount" := Amount;
          GLEntry.Amount := 0;
        END;
        // Store Entry No. to global variable for return:
        GLEntryNo := GLEntry."Entry No.";
        InitVAT;
        InsertGLEntry(TRUE);
        PostJob;
        PostVAT;
      END;

    If you need to see full debug log file, click here.

    If you need anything else for me to do on my part, let me know!

    Thank you so much!

    Djole

  • AJAnsari Profile Picture
    AJAnsari 5,754 on at
    RE: MS Dynamics NAV 2013 - NOLOCK error

    Please navigate to the Sessions page, select the session you're running, and turn on debugging, and then recreate the error. If you can share screenshots of what you see while debugging, this will help the community help you figure out what's causing the issue.

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