2-6
In this exercise, you will practice using the READ COMMITTED SNAPSHOT isolation level.
2-6a
If you are running against an on-premises SQL Server instance, turn on READ_COMMITTED_SNAPSHOT
in the TSQL2012 database (on by default in SQL Database).
ALTER DATABASE TSQL2012 SET READ_COMMITTED_SNAPSHOT ON;
2-6b
Open two new connections. (This exercise will refer to them as Connection 1 and Connection 2.)
2-6c
Run the following code in Connection 1 to open a transaction, update rows in Sales.OrderDetails, and
query it.
BEGIN TRAN;
UPDATE Sales.OrderDetails
SET discount += 0.05
WHERE orderid = 10249;
SELECT orderid, productid, unitprice, qty, discount
FROM Sales.OrderDetails
WHERE orderid = 10249;
www.it-ebooks.info
Do'stlaringiz bilan baham: |