Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

C/AL LOCKTABLE command

(0) ShareShare
ReportReport
Posted on by 160

Hello, please help with the below question regarding LOCKTABLE command.

Which statement(s) below about C/AL LOCKTABLE command is true?

A. All records in the table read by SQL Server are locked to ensure database integrity.
B. The command is valid for all subsequent instances of record variables based on the table within the transaction.
C. Only records in the table within the filter are locked by SQL Server to ensure database integrity.
D. The command locks the table in SQL Server to ensure database integrity.

Regards,

Steve

*This post is locked for comments

  • Verified answer
    Jens Glathe Profile Picture
    Jens Glathe 6,092 on at
    RE: C/AL LOCKTABLE command

    Hi Steve,


    who still needs the MB7-702 cert? ;) Anyway, this is one of the rather useful questions in this exam. Let's have a look at the answers:


    A: This is correct, the more precise term would be "subsequently read after issuing the locktable command". SQL Server only places a lock on the records that are read after issuing a locktable on a table. And only on these records (page lock), as long as no lock escalation is taking place and the whole table will be locked. You have no direct way of controlling it from NAV, btw.

    B: True. Only one locktable for one record variable instance is needed.

    C: [pedantic] False. This answer doesn't state that these records are actually read from the SQL Server.

    D: False. This only happens when lock escalation occurs, which takes quite a lot of reads on a locked table to happen depending on the memory ressources of the SQL Server. Or on the native server, which is no longer supported (NAV2013).

    So, the answer should be AB.


    with best regards


    Jens

  • Lars Veldhuis Profile Picture
    Lars Veldhuis 5 on at
    RE: C/AL LOCKTABLE command

    I think that D is more correct than B, because LOCKTABLE locks all records BEFORE read

  • Suggested answer
    Roberto Stefanetti Profile Picture
    Roberto Stefanetti 12,998 on at
    RE: C/AL LOCKTABLE command

    hi,

    i think B & D

    (A & C answers are about records subject, not table subject)

    LOCKTABLE Function (Record)

    msdn.microsoft.com/.../dd301298(v=nav.71).aspx

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,309 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans