How to change lock strategy in SQL Server?

I read such articles: http://www.codinghorror.com/blog/archives/001166.html http://www.databasejournal.com/features/mssql/article.php/3566746/Controlling-Transactions-and-Locks- Part-5-SQL-2005-Snapshots.htm

And from what I understand, SQL Server has a very pessimistic locking strategy. And to improve performance, I have to change the Read Committed Snapshot lock.

But I can’t find where to do this. Where can I change my blocking strategy?

+5
source share
3 answers

, ALTER.

:

ALTER DATABASE YourDatabaseName SET READ_COMMITTED_SNAPSHOT ON;

, : .

EDIT: , .

+5

SNAPSHOT tempdb .

. SET ISOLATION LEVEL .NET.

, SQL Server , (.. ), , WITH (ROWLOCK) .

UPDATE YourTable (WITH ROWLOCK)
   SET Col2 = 3
WHERE Col1 = 'test'

, ROWLOCK , , tempdb, tempdb.

+1

,

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED 

, , , . READ UNCOMMITTED , .

0

All Articles