How to Read UnCommitted Data / Dirty Records from SQL Server Table - SQL Server Tutorial

preview_player
Показать описание
How to Read Uncommitted Rows from SQL Server Table by using WITH (NOLOCK) Hint - TSQL Tutorial
By default isolation level of SQL Server Database Engine is READ COMMITTED. That mean if we try to select the rows, it will only return us only committed rows.

To Check the Default Isolation level of SQL Sever we can use

DBCC useroptions

Let's consider couple of scenarios where we want to read uncommited data

We are deleting alot of records from Table and want to take a look on progress
We are inserting a lot of records by using SSIS Package, even the records are not committed, we want to see the progress of load.

OR

Sometime we are preparing our Scripts for deployments and we run the statement and then want to see if script worked as expected before committing the transaction.

WITH (NOLOCK) is hint that we can use to read dirty or uncommitted records.

Blog post link for this video with scripts
Рекомендации по теме
Комментарии
Автор

No Lock explained with example

Thanks for educating the community

krismaly
Автор

Bro plz change ur English accent i think it won't be understood by many

VlogAndVoyage_veda