code_junkie

SQL 2005: NOLOCK hint dramatically increases reads. WTF?

Nov 13th, 2011
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. SELECT * FROM dbo.<table-name> WITH (NOLOCK).
  2.  
  3. create table table1 (id int, val int)
  4. go
  5.  
  6. select * from table1 with ( NoLock)
  7. begin tran
  8. insert into table1 values (1,1)
  9.  
  10. --Switch to new query window
  11. select * from table1 with ( NoLock)
  12. --switch back
  13. rollback tran
  14. select * from table1 with ( NoLock)
Add Comment
Please, Sign In to add comment