Options

Table Locking and Management Studio

bstapyltonbstapylton Member Posts: 34
Hi guys,


I'm just curious - if I were to run a query against a NAV table (say, Sales Line) using t-sql in SQL Server Management Studio, what would the implications on table locking be?


Lets say the query took 20 seconds to run. Would the table be locked if a NAV user wished to access the table in any way?


Thanks for your help :)

Comments

  • DenSterDenSter Member Posts: 8,307
    depends on what query you run. If you're just reading it won't be locked unless you tell it to be locked.
  • bstapyltonbstapylton Member Posts: 34
    It would just be a SELECT query.


    I was thinking the same thing - a read-only query shouldn't lock the table, it doesn't make sense to.
  • strykstryk Member Posts: 645
    If you just execute a SELECT without specifying any locking behavior etc. then SQL Server will use the standard Transaction Isolation Level "READ COMMITTED".
    So you won't block anyone, but it could happen that you are blocked, e.g. if another user is writing data into this table.

    Regards,
    Jörg
    Jörg A. Stryk (MVP - Dynamics NAV)
    NAV/SQL Performance Optimization & Troubleshooting
    STRYK System Improvement
    The Blog - The Book - The Tool
Sign In or Register to comment.