Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

1062


Part VIII: Performance Tuning and Optimization


To execute the code, you need to do the following:

Create two Query windows.
In one paste the following:
USE AdventureWorks2012

BEGIN TRANSACTION

--Step 1
UPDATE Person.Person
SET LastName = 'Chapman'
WHERE BusinessEntityID = '101'

--Step 3
UPDATE Production.Product
SET Name = 'DeadLock Identification Tester'
WHERE ProductNumber = 'FR-R38R-44'

COMMIT TRANSACTION

In the second window paste:
USE AdventureWorks2012

BEGIN TRANSACTION

--Step 2
UPDATE Production.Product
SET Name = 'DeadLock Repair Kit'
WHERE ProductNumber = 'FR-R38R-44'

UPDATE Person.Person
SET FirstName = 'Tim'
WHERE BusinessEntityID = 101

COMMIT TRANSACTION

Executing step 1 in the fi rst query window:

USE AdventureWorks2012

BEGIN TRANSACTION

--Step 1
UPDATE Person.Person
SET LastName = 'Chapman'
WHERE BusinessEntityID = '101'

c47.indd 1062c47.indd 1062 7/31/2012 10:23:29 AM7/31/2012 10:23:29 AM


http://www.it-ebooks.info
Free download pdf