Nav 2017 Database locks backport to Nav 2016

Hi All,

I know we have database locks page/table in nav 2017. I was wondering if we can create a SQL view in nav 2016 to achieve the same result. I will then link this view to a table in 2016.

So far i have created this
SELECT

OBJECT_NAME(p.OBJECT_ID) AS TableName,

resource_type, resource_description, request_session_id

FROM sys.dm_tran_locks l

JOIN sys.partitions p ON l.resource_associated_entity_id = p.hobt_id


rgmy6o6p4mac.png


But NAV is also providing NAV object name , ID etc as well. How would i add those to my view? Goal is to have the exact same result as we get in NAV table in 2017

Answers

  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    edited 2017-12-25
    You cannot I'm afraid.

    Object Name/ID is the NAV thing, and you are pulling your locking data directly from the SQL Server, which has no knowledge of those. You won't be even able to tell who is locking as there is no 1:1 mapping between NAV and SQL sessions.
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.