Aan de slagGa gratis aan de slag

Avoid being blocked

You are trying to select every movement of account 1 from the transactions table. When selecting that information, you are blocked by another transaction, and the result doesn't output. Your database is configured under the READ COMMITTED isolation level.

Can you change your select query to get the information right now without changing the isolation level? In doing this you can read the uncommitted data from the transactions table.

Deze oefening maakt deel uit van de cursus

Transactions and Error Handling in SQL Server

Cursus bekijken

Oefeninstructies

  • Change your script to avoid being blocked.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

SELECT *
	-- Avoid being blocked
	FROM transactions ___ (___LOCK)
WHERE account_id = 1
Code bewerken en uitvoeren