Quantcast
Channel: Locking and Blocking – Curated SQL
Viewing all articles
Browse latest Browse all 25

NOLOCK, No Problem?

$
0
0

Arun Sirpal explains that NOLOCK not only takes locks, but also lets you read invalid data:

A Sch-S (schema stability) lock is taken.  This is a lightweight lock; the only lock that can conflict with this is a Sch-m (schema modification) lock. (C = Conflict). This means that a NOLOCK can actually block for example against an ALTER TABLE command.

I would lean heavily toward turning on Read Committed Snapshot Isolation instead of using NOLOCK in most environments.  It’s something you’d need to test, but it does come with fewer bad ramifications.


Viewing all articles
Browse latest Browse all 25

Trending Articles