You are here: Re: NOLOCK and READPAST on same table? « MsSQL Server « IT news, forums, messages
Re: NOLOCK and READPAST on same table?

Posted by Erland Sommarskog on 09/18/05 00:19

laurenq uantrell (laurenquantrell@hotmail.com) writes:
> Is it possible to use With (NOLOCK) and With (READPAST) in the same
> SELECT query and what whould be the syntax?

The syntax would be

SELECT ... FROM tbl WITH (NOLOCK, READPAST)

But I got the error message:

Server: Msg 650, Level 16, State 1, Line 1
You can only specify the READPAST lock in the READ COMMITTED or
REPEATABLE READ isolation levels.

Which makes sense. READPAST means that you skip rows that you would be
blocked on, and you will not be blocked with NOLOCK.

What are you trying to achieve?

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация