0

Just wanting to know what a Dirty Read is. If anyone could sum it up shortly and briefly that'd help. Looked online and nothing is really clicking to me. Appreciate the help, thanks.

Can you also give a simple clear example? Thank You.

Jona
  • 413
  • 3
  • 16
  • 1
    Reading data that hasn't been commited yet and may be rolled back. If you use `NOLOCK` it's extra-dirty: you may see the same row twice if the data is moved due to insertions – Panagiotis Kanavos Jun 12 '19 at 14:52
  • 1
    Did you even try? https://www.google.com/search?q=sql+dirty+read If you saw the articles listed and you don't understand that what part of it is not clear? – Sean Lange Jun 12 '19 at 14:52
  • https://logicalread.com/sql-server-concurrency-dirty-reads-w01/#.XQERm1wzaUk – Claudio Corchez Jun 12 '19 at 14:53
  • Appreciate the help given. Really new to SQL and different types of reads hence why every article I was reading was for intermediate SQL'rs. – Jona Jun 12 '19 at 15:20

1 Answers1

0

A dirty read is an event, when you read with an 2nd transaction Values from the 1st transaction, which isn't commited.

Means: When the 1st transaction is aborted through an error or through manipulating by an user, the Values from the 2nd transaction aren't valid anymore.

LoaStaub
  • 78
  • 14
  • 2
    To be fair, it's not a guarantee that the transaction (and therefore the state of the data) will be rolled back. But, *it could be* and so you're rolling the dice. – Ben Thul Jun 12 '19 at 16:23