Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

How to find out which process causes a table lock?

Posted on by Microsoft Employee

Hey guys,

my customer has the problem, that they have sometimes table locks, but they never know, what they caused.

So now I am thinking about a way, how I can find out what process caused it.

Do you have a strategy, to find out such table locks?

  • Suggested answer
    RE: How to find out which process causes a table lock?

    No, you cannot find a locked table a month ago, not to my knowledge.

    You can only try to find out which user is locking a table and then ask the user what process he/she was running.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to find out which process causes a table lock?

    Hey,

    I already know this query, the problem is, that I would like to know, who has locked a table also one month or so ago and not in the current session. Is this somehow possible? My customer has such table locks and later they report me, they had again that issue...

  • Suggested answer
    RE: How to find out which process causes a table lock?

    Hello,

    You can find out which user is blocking by starting SQL Server Management Studio, find the database and run a query with exec sp_who2

    This gives a dump of all current user activity. There is a column called BlkBy, which stands for Blocked By. That gives you the SPID (SQL Process ID) of the person blocking. Find that entry for the BlkBy SPID in this list and that will give you the user who is blocking. You can ask the user what process was running. Hope this helps.

     

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: How to find out which process causes a table lock?

    Hello,

    You may want to use the community postings for this as a starter.

    community.dynamics.com/.../table-locked-by-another-user

    Thanks.

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans