Code Snippet posted by: Akiii
| Posted on: 8/6/2012 | Category: SQL Server Codes
| Views: 468 | Status: [Member]
| Points: 40
| Alert Moderator
select * from customer with (nolock);
select * from customer;
Both the above statements will give you the same results. But, there is a catch. Suppose customer table is being updated and then you execute the first query containing nolock then it might result in DIRTY READ.
- It only applies to the SELECT statement. it does'nt consider the transaction scenario, even if the transaction is under process or not yet committed or rollback, it will fetch the current record no matter what. Use this feature when the performance needs to be increased.
Thanks and Regards