|
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]
|