I am running following SQL statement on SQL Azure database:
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ;
BEGIN TRANSACTION;
UPDATE Project SET Name = 'NewLim2' WHERE Projectid = 403179
WAITFOR DELAY '00:00:10'
COMMIT TRANSACTION
Then during the 10 seconds delay I use another connection which performs following select:
SELECT * FROM Project WHERE Projectid = 403179
But its result is 'NewLim' as Name (original value) and 'NewLim2' is after the committing. When I run transaction with Read uncommitted I suppose that it will read updated value even before commit. Or am I missing something?
3条答案
按热度按时间hk8txs481#
You need
before your Select statement.
hc8w905p2#
Just wanted to point out,Isolation levels are only for select Statements,below statement you have in your update doesn't make any sense
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ;
Reason why you didn't got uncommitted data was due not having required Isolation level in your select as mentioned in answer
bvjveswy3#
Can't you just make your query, ending by "WITH UR" like we can do in e.g. DB2?
So: