Quick question? Table Hints , with(NoLock) and with (readuncommitted) are only able to bypass DML and Not DDL right?
Let’s say if I have something like
Begin Tran
Update dbo.Staff
Set contactID = 7
Where Name = Ivan
And I don’t rollback the transaction
Then someone else writes a query to access the records in the staff table.
Select *
From dbo.staff With (nolock)
They would be able to read the uncommitted data( which would be considered a dirty read) if the connection is set to read uncommitted.
On flip side though if I write a query that changes the structure of a table
Begin Tran
Alter Table dbo.staff Add column _G varchar(30)
And that query isn’t committed
And someone tries execute the following:
Select *
From dbo.staff With (nolock)
It won’t be able to bypass
due to it being DDL.