Databases Reference
In-Depth Information
10. In the query window (Connection-1), type the following T-SQL statements and then
execute them, to begin a transaction from Connection-1:
USE AdventureWorks2012
GO
--Execute this script from Connection-1
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
GO
BEGIN TRANSACTION
SELECT * FROM Sales.SalesOrderDetail
WHERE SalesOrderDetailID = 121316
11. Now, open another query window (Connection-2). Type the following T-SQL script, and
then execute the script to begin a transaction from Connection-2:
USE AdventureWorks2012
GO
--Execute this script from Connection-2
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
BEGIN TRANSACTION
SELECT * FROM Sales.SalesOrderDetail
WHERE SalesOrderDetailID = 121317
12. Now, in the first query window (Connection-1), type the following query underneath
previously entered T-SQL statements. Select and highlight the following query and
execute this query only, to try to update the record:
--Execute this script from Connection-1
UPDATE Sales.SalesOrderDetail
SET OrderQty = 2
WHERE SalesOrderDetailID = 121317
13. Next, in the second query window (Connection-2), type the following query
underneath previously entered T-SQL statements. Select and highlight the
following query, and execute this query only, to try to update the record:
--Execute this script from Connection-2
UPDATE Sales.SalesOrderDetail
SET OrderQty = 2
WHERE SalesOrderDetailID = 121316
 
Search WWH ::




Custom Search