Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set transaction isolation level as read uncommitted as default for users

Is it possible to set the transaction isolation level to read uncommitted for users by default in MS SQL Server Management Studio 2012?

I was thinking it could either be done through editing a config file or changing a reg key but i haven't been able to locate anything that would change this yet.

like image 691
mhp1990 Avatar asked Feb 09 '23 04:02

mhp1990


2 Answers

As far as I know you can't change the default lock level.

For workloads with a lot of reads and fewer writes, you can avoid blocking queries with multiversion concurrency control. That's the default for Postgres and Oracle. In SQL Server, MVCC is called "read committed snapshot", and you can enable it with:

ALTER DATABASE YourDb SET READ_COMMITTED_SNAPSHOT ON;
like image 96
Andomar Avatar answered Feb 10 '23 22:02

Andomar


You can’t. The default isolation level for all SQL Server databases is Read Committed, and your only option is to set the isolation level within a session, if you want to use a level other than the default.

You could also set SET TRANSACTION ISOLATION LEVEL within stored procedure body.

like image 42
fabulaspb Avatar answered Feb 10 '23 21:02

fabulaspb