May 13, 2005 at 6:58 am
Hi,
I am working in a project for a company. Currently, I am using sql server 2000 and visual basic as well as COM+.
I want to create a senario where when a process A is updating a particular field of a particular row in a table, another process B can still read from that row, even when process A has not yet committed its transaction. To achieve that, I use read uncommitted for the latter process.
However, after doing some experiment, I realize read uncommitted is actually dirty read, which mean, when A update (but not yet committed), say a value of a field, say from 4 to 10, B will end up reading 10. That is, read uncommitted, actually read the changes that has not yet been committed.
However, my boss wants porcess B to read the value 4, not 10!!!! That is B should read the value that is still stored in the database , not the value that is in the memory. How is it possible for me to achieve that?
Regards,
Daniel
May 13, 2005 at 11:00 am
This issue has come up several times recently and to the best of my knowledge, under sql server 2000, you cannot read the prior value of a row once the update has started.
You will be able to do this under Sql Server 2005 using Read Committed Snapshot Isolation. Here's an article with full information:
http://www.microsoft.com/technet/prodtechnol/sql/2005/SQL05B.mspx
May 13, 2005 at 1:59 pm
You could, as a kludge, make another table of the same structure and insert the original values there and use that information for Process B? You would have to TRUNCATE TABLE before inserting the original values. Not very pretty, but it might work.
I wasn't born stupid - I had to study.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply