You are here: Re: Admin Version of WITH(UPDLOCK)? « MsSQL Server « IT news, forums, messages
Re: Admin Version of WITH(UPDLOCK)?

Posted by Erland Sommarskog on 07/26/06 07:47

Jerry Hewett (jerhewet@yahoo.com) writes:
> Is there anything I can do from the Enterprise Manager console or from
> within a JDBC connection to achieve the same effect as WITH(UPDLOCK)?
>
> Yes, I could change all of my SQL statements to include the lock... but
> isn't there any way to set or tweak something in SQL Server so that I
> won't have to hack a lot of code* to make things concurrent? Perhaps a
> way to set UPDLOCK as the default behaviour for the server, or schema,
> or table, or something?

You can use SET TRANSACTION ISOLATION LEVEL to change the default isolation
level for the transaction. However, UPDLOCK does not map to an isolation
level, and in any case I don't think you would want that lock on every
SELECT statement. Maybe you can tell us a little more on what you want to
achieve?


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

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

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

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