What are Dirty Reads in SQL Server











>> YOUR LINK HERE: ___ http://youtube.com/watch?v=y06ExCznT_Y

Another video brought to you by BeardedDev, bringing you tutorials on Data Engineering, Business Intelligence, T-SQL Programming and Data Analysis. • If you like the video you can support me on Patreon,   / beardeddev   • In this SQL Tutorial, I use the AdventureWorks2019 database, if you wish to follow along you can download the .bak file from: https://docs.microsoft.com/en-us/sql/.... • In the video I discuss the battle between high concurrency and accurate data, if we lower our requirements for data accuracy we can increase the amount of users that are able to access the data at the same time, if we lower the amount of users that can access the data at the same time, we can increase data accuracy. To find the ideal needs a bit of thought and SQL Server has a built in TRANSACTION ISOLATION LEVEL that Microsoft believes is the happy medium, READ COMMITTED. • I demonstrate what dirty reads are and talk about the problems they can cause, you can also follow along with the tutorial and use the code samples below. There are two ways dirty reads can be introduced either by setting TRANSACTION ISOLATION LEVEL to READ UNCOMMITTED - this applies to the session or using hint NOLOCK - this applies to the table only. • I also discuss how READ COMMITTED guards against dirty reads by acquiring exclusive locks on the modified data meaning that data cannot be read until a transaction has committed or rolled back. • Code Samples • -- Query 1 • SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; • SELECT • SalesOrderID, • DueDate • FROM Sales.SalesOrderHeader • WHERE SalesOrderID = 75123; • -- Query 2 • SELECT • SalesOrderID, • DueDate • FROM Sales.SalesOrderHeader • WHERE SalesOrderID = 75123; • -- Query 3 • BEGIN TRAN • UPDATE Sales.SalesOrderHeader • SET DueDate = '20210101' • WHERE SalesOrderID = 75123; • -- ROLLBACK TRAN

#############################












Content Report
Youtor.org / YTube video Downloader © 2025

created by www.youtor.org