web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Suggested answer
    Roberto Stefanetti Profile Picture
    12,998 on at

    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

  • Lars Veldhuis Profile Picture
    5 on at

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

  • Verified answer
    Jens Glathe Profile Picture
    6,092 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans