Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

MS Dynamics NAV 2013 - NOLOCK error

(0) ShareShare
ReportReport
Posted on by

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
    6,663 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
    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
    37,166 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
    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
    37,166 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
    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
    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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans