question

RBarryYoung avatar image
RBarryYoung asked

Isolation Levels

I have participated in several of the StackOverflow sites, and one of the things that I have noticed is that there is a real "bootstrap" problem in the beginning. There really needs to be a certain minimum number of active members with a minimum number of points before it really starts to work. In the interests of addressing this, (and unless the powers that be object) I will be posting challenge questions based on some of the older SqlServerCentral Questions Of The Day. The first answer which is correct will be marked as accepted (15 points). For the most part I will not be presenting the questions as multiple choice, as they originally were.


A great QotD from bitbucket:

Isolation levels - Database Engine

In my SQL 2005 database the following transaction starts

BEGIN TRAN
SELECT Val FROM T WHERE ID = 2

Returned value is Original. A moment later the following starts on another connection:

BEGIN TRAN
UPDATE T SET VAL = 'Gotcha' WHERE ID =2
SELECT Val FROM T WHERE ID =2

Returned value is Gotcha. The first transaction continues and again executes before the 2nd transaction committs

SELECT Val FROM T WHERE ID = s

Returned value is Original. The question is what Isolation Level is being used by my database?

blockingisolation-levelchallengeqotd
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered

Your database is using read committed isolation level. Although it could also be using snapshot isolation or read committed snapshot isolation.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.