12 Sep
Posted by Jayce as Programming
SET TRANSACTION ISOLATION LEVEL is the controls that lock and row versioning behavior of Transact-SQL statements issued by a connection to SQL Server. There are 5 levels for SET TRANSACTION ISOLATION LEVEL. There are READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SNAPSHOT and SERIALIZABLE. By default, SQL Server set ‘SET TRANSACTION ISOLATION LEVEL READ COMMITTED’ as default. So what does each of them mean?
READ UNCOMMITTED
Specifies that statements can read rows that have been modified by other transactions but not yet committed.
READ COMMITTED
Specifies that statements cannot read data that has been modified but not committed by other transactions. This prevents dirty reads. Data can be changed by other transactions between individual statements within the current transaction, resulting in nonrepeatable reads or phantom data.
REPEATABLE READ
Specifies that statements cannot read data that has been modified but not yet committed by other transactions and that no other transactions can modify data that has been read by the current transaction until the current transaction completes.
SNAPSHOT
Specifies that data read by any statement in a transaction will be the transactionally consistent version of the data that existed at the start of the transaction. The transaction can only recognize data modifications that were committed before the start of the transaction. Data modifications made by other transactions after the start of the current transaction are not visible to statements executing in the current transaction. The effect is as if the statements in a transaction get a snapshot of the committed data as it existed at the start of the transaction.
SERIALIZABLE
Statements cannot read data that has been modified but not yet committed by other transactions.
No other transactions can modify data that has been read by the current transaction until the current transaction completes.
Other transactions cannot insert new rows with key values that would fall in the range of keys read by any statements in the current transaction until the current transaction completes.
Tags: Transact-SQL
5 Responses
Bernie
September 12th, 2008 at 6:12 pm
1Hahahaha welcome to the world of database transactions
Jayce
September 12th, 2008 at 6:27 pm
2SELECT… SELECT…. FROM… FROM… WHERE… WHERE…
iCalvyn
September 13th, 2008 at 1:12 pm
3Ops… i long time did not touch on database…
Jayce
September 13th, 2008 at 4:11 pm
4System engineer does not need to touch on database lo.
Table (NOLOCK) (Transact-SQL) by Jayce Ooi’s Paradise
September 16th, 2008 at 9:56 am
5[…] SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED / READ COMMITTED / REPEATABLE READ / SNAPSHOT / SER… too. Share and Enjoy: These icons link to social bookmarking sites where readers can share and […]
RSS feed for comments on this post · TrackBack URI
Leave a reply
Categories
Archives
Chat Chat Chat...
SP Blogger
Isabell Online Penang Florist
Recent Entries
Recent Comments
Top Commentators
Jayce Ooi’s Paradise is proudly powered by WordPress - All rights reserved ~ Privacy ~ Disclosure Policy ~ sitemap.xml
Jayce Ooi's Paradise ~ i-City Portal ~ Pretty Girl 2 u ~ SP Blogger ~ Forum at JayceOoi.com