SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


NOLOCK Hint Corrupts Results from SELECT


NOLOCK Hint Corrupts Results from SELECT

Author
Message
Langston Montgomery
Langston Montgomery
SSC-Addicted
SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)

Group: General Forum Members
Points: 484 Visits: 508
Update:

We upgraded the production server to SP1, and the issue is gone. Lunch for anyone who can figure out why it was happening :-)
Bhuvnesh
Bhuvnesh
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32290 Visits: 4079
hisakimatama (11/8/2012)
If my understanding of the dirty reads process is correct, even if all transactions at a given time have been committed, page splits may still occur for a short time afterwards. If you query a table using NOLOCK during that time period and a page split occurs, the data will be shuffled around throughout the table to accomodate the split, and as such, you may end up with data returned from the NOLOCK operation that corresponds to a location in memory that doesn't hold the data you originally wanted. My understanding might be a little off, but the article should be much more succint :-)
@gsquard , can you please put some light here

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
TheSQLGuru
TheSQLGuru
SSC Guru
SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)SSC Guru (76K reputation)

Group: General Forum Members
Points: 76711 Visits: 8873
Langston Montgomery (11/26/2012)

Update:

We upgraded the production server to SP1, and the issue is gone. Lunch for anyone who can figure out why it was happening :-)


Seems pretty obvious what was happening: you experienced the effects of a bug in the product that was fixed by the SQL Server patch you applied. End of story. Do I get a prize?? Hehe

Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
MMartin1
MMartin1
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15964 Visits: 2080
It may not be a bad idea to have the server and other workstations check apply updates automatically to Windows and applications.

----------------------------------------------------
How to post forum questions to get the best help
Jared Karney
Jared Karney
SSC-Dedicated
SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)

Group: General Forum Members
Points: 35547 Visits: 3703
mmartin1 (11/28/2012)
It may not be a bad idea to have the server and other workstations check apply updates automatically to Windows and applications.
Yes it would. This should administered by a systems or domain administrator.

Thanks,
Jared
PFE - Microsoft
SQL Know-It-All
How to post data/code on a forum to get the best help - Jeff Moden
Langston Montgomery
Langston Montgomery
SSC-Addicted
SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)SSC-Addicted (484 reputation)

Group: General Forum Members
Points: 484 Visits: 508
SQLKnowItAll (11/28/2012)
mmartin1 (11/28/2012)
It may not be a bad idea to have the server and other workstations check apply updates automatically to Windows and applications.
Yes it would. This should administered by a systems or domain administrator.


Thanks. We let Server Ops know ;-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search