Database Reference
In-Depth Information
6.
The sample lock information results are as follows:
resource_
type
resource_
associated_entity_
id
request_
status
request_mode request_
session_
id
PAGE
72057594045595648
GRANT
IS
56
KEY
72057594045595648
GRANT
RangeS-S
53
DATABASE
0
GRANT
S
56
7.
Again, open another New Query window and execute the following TSQL statement:
--Start a new query window session for this query on the same SSMS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
GO
USE AdventureWorks2008R2;
GO
BEGIN TRAN
SELECT Name, ProductNumber, ListPrice AS Price,ProductLine,DaysToM
anufacture
FROM Production.Product
WITH (TABLOCK, HOLDLOCK)
WHERE ProductLine = 'M'
AND DaysToManufacture <2
ORDER BY Name ASC;
GO
8.
Now, display locking information for this connection:
--Display lock information
SELECT resource_type, resource_associated_entity_id,
request_status, request_mode,request_session_id,
resource_description
FROM sys.dm_tran_locks
WHERE resource_database_id = DB_ID('AdventureWorks2008R2');
9.
The sample lock information for the second query session is as follows:
resource_
type
resource_associated_
entity_id
request_
status
request_
mode
request_
session_id
resource_
description
DATABASE
0
GRANT
S
60
KEY
72057594045595648
GRANT
RangeS-S
56
(8a73891e1f87)
PAGE
72057594045595648
GRANT
IS
53
1:819
OBJECT
1717581157
GRANT
S
59
 
Search WWH ::




Custom Search