1

Consider the following SQL statement:

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
BEGIN TRANSACTION

insert into Customer(name)
values('CustomerName')

COMMIT

Am I right in saying this Isolation Level is not needed since we are doing a simple insert? Not actually READing anything

8
  • Are you using SQL Server? Please label with the actual database you are using. Commented Jan 16, 2017 at 11:52
  • yes - thanks - MS SQL Server 2014 Commented Jan 16, 2017 at 11:55
  • I'd start from a different place. If you have a specific situation where dirty reads would be acceptable, consider whether this or a query hint may be appropriate. Not "let's sprinkle this setting everywhere and then see what fires I have to put out". Commented Jan 16, 2017 at 11:56
  • 1
    Did you consider that under READ UNCOMMITTED someone could do a dirty read while you are inserting and therefore get unexpected results? Commented Jan 16, 2017 at 11:56
  • 1
    @TimBiegeleisen - only if that other connection has itself opted for READ UNCOMMITTED. In general, these settings affect the results or locks that your own connection will be subject to rather than those experienced by other connections. Commented Jan 16, 2017 at 11:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.