Skip to content

Commit 3df7501

Browse files
author
PRMerger6
authored
Merge pull request MicrosoftDocs#4955 from pmasl/patch-171
Update sys-dm-tran-locks-transact-sql.md
2 parents 5bd6f43 + e648edb commit 3df7501

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

docs/relational-databases/system-dynamic-management-views/sys-dm-tran-locks-transact-sql.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ms.workload: "On Demand"
3636
The columns in the result set are divided into two main groups: resource and request. The resource group describes the resource on which the lock request is being made, and the request group describes the lock request.
3737

3838
> [!NOTE]
39-
> To call this from [!INCLUDE[ssSDWfull](../../includes/sssdwfull-md.md)] or [!INCLUDE[ssPDW](../../includes/sspdw-md.md)], use the name **sys.dm_pdw_nodes_tran_locks**.
39+
> To call this from [!INCLUDE[ssSDWfull](../../includes/sssdwfull-md.md)] or [!INCLUDE[ssPDW](../../includes/sspdw-md.md)], use the name **sys.dm_pdw_nodes_tran_locks**.
4040
4141
|Column name|Data type|Description|
4242
|-----------------|---------------|-----------------|
@@ -65,8 +65,6 @@ ms.workload: "On Demand"
6565
On [!INCLUDE[ssNoVersion_md](../../includes/ssnoversion-md.md)], requires `VIEW SERVER STATE` permission.
6666
On [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)] Premium Tiers, requires the `VIEW DATABASE STATE` permission in the database. On [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)] Standard and Basic Tiers, requires the **Server admin** or an **Azure Active Directory admin** account.
6767

68-
69-
7068
## Remarks
7169
A granted request status indicates that a lock has been granted on a resource to the requestor. A waiting request indicates that the request has not yet been granted. The following waiting-request types are returned by the **request_status** column:
7270

@@ -290,7 +288,7 @@ On [!INCLUDE[ssSDS_md](../../includes/sssds-md.md)] Premium Tiers, requires the
290288
### A. Using sys.dm_tran_locks with other tools
291289
The following example works with a scenario in which an update operation is blocked by another transaction. By using **sys.dm_tran_locks** and other tools, information about locking resources is provided.
292290

293-
```
291+
```sql
294292
USE tempdb;
295293
GO
296294

@@ -328,7 +326,7 @@ BEGIN TRAN
328326

329327
The following query will display lock information. The value for `<dbid>` should be replaced with the **database_id** from **sys.databases**.
330328

331-
```
329+
```sql
332330
SELECT resource_type, resource_associated_entity_id,
333331
request_status, request_mode,request_session_id,
334332
resource_description
@@ -346,7 +344,7 @@ SELECT object_name(object_id), *
346344

347345
The following query will show blocking information.
348346

349-
```
347+
```sql
350348
SELECT
351349
t1.resource_type,
352350
t1.resource_database_id,
@@ -361,7 +359,7 @@ SELECT
361359

362360
Release the resources by rolling back the transactions.
363361

364-
```
362+
```sql
365363
-- Session 1
366364
ROLLBACK;
367365
GO
@@ -374,7 +372,7 @@ GO
374372
### B. Linking session information to operating system threads
375373
The following example returns information that associates a session ID with a Windows thread ID. The performance of the thread can be monitored in the Windows Performance Monitor. This query does not return session IDs that are currently sleeping.
376374

377-
```
375+
```sql
378376
SELECT STasks.session_id, SThreads.os_thread_id
379377
FROM sys.dm_os_tasks AS STasks
380378
INNER JOIN sys.dm_os_threads AS SThreads
@@ -386,9 +384,6 @@ GO
386384

387385
## See Also
388386
[sys.dm_tran_database_transactions &#40;Transact-SQL&#41;](../../relational-databases/system-dynamic-management-views/sys-dm-tran-database-transactions-transact-sql.md)
389-
[Dynamic Management Views and Functions &#40;Transact-SQL&#41;](~/relational-databases/system-dynamic-management-views/system-dynamic-management-views.md)
387+
[Dynamic Management Views and Functions &#40;Transact-SQL&#41;](../../relational-databases/system-dynamic-management-views/system-dynamic-management-views.md)
390388
[Transaction Related Dynamic Management Views and Functions &#40;Transact-SQL&#41;](../../relational-databases/system-dynamic-management-views/transaction-related-dynamic-management-views-and-functions-transact-sql.md)
391389

392-
393-
394-

0 commit comments

Comments
 (0)