April 20, 2006 at 6:21 am
Hi,
I have executed "select * from tbl" from QA. Due to locks, it didn't show any records. Then I issued "select * from tbl (nolock)" and it showed all the rows and some of the rows had null values in the PK column. I check for the processes and found deadlock in one process and killed it. Then I issued "select * from tbl" and it showed all the values. Meanwhile the client programs, had accessed the PK values.
Any idea why did it happen?
Thanks,
R.Prakash
R
April 20, 2006 at 8:38 am
The no lock hint is equivalent to running in read uncommitted isolation level. This means that you could have dirty reads. I would guess that the nulls came from uncommitted data.
April 21, 2006 at 3:25 am
I agree. I would be very careful about using (NOLOCK) in production if your data consistency actually matters... According to me people put in (NOLOCK) too often without thinking what it could cause.
Hans
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply