SQL-Befehle im NAV-Umfeld: Unterschied zwischen den Versionen
Aus MattWiki
Matt (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „=== Useraktivitäten === <syntaxhighlight lang="sql">sp_who2 select percent_complete, * from sys.dm_exec_requests</syntaxhighlight> Category:SQL“) |
Matt (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 1: | Zeile 1: | ||
=== Useraktivitäten === | === Useraktivitäten === | ||
<syntaxhighlight lang="sql">sp_who2 | <syntaxhighlight lang="sql">sp_who2 # Einzelnes Abfragefenster benutzen | ||
select percent_complete, * from sys.dm_exec_requests</syntaxhighlight> | select percent_complete, * from sys.dm_exec_requests # Einzelnes Abfragefenster benutzen</syntaxhighlight> | ||
=== Wer sperrt was? === | |||
<syntaxhighlight lang="sql">SELECT tl.resource_type, | |||
tl.resource_associated_entity_id, | |||
OBJECT_NAME(p.object_id) AS object_name, | |||
tl.request_status, | |||
tl.request_mode, | |||
tl.request_session_id, | |||
tl.resource_description | |||
FROM sys.dm_tran_locks tl | |||
LEFT JOIN sys.partitions p | |||
ON p.hobt_id = tl.resource_associated_entity_id | |||
WHERE tl.resource_database_id = DB_ID() | |||
AND p.object_id IS NOT NULL</syntaxhighlight> | |||
[[Category:SQL]] | [[Category:SQL]] |
Version vom 20. März 2014, 14:58 Uhr
Useraktivitäten
sp_who2 # Einzelnes Abfragefenster benutzen
select percent_complete, * from sys.dm_exec_requests # Einzelnes Abfragefenster benutzen
Wer sperrt was?
SELECT tl.resource_type,
tl.resource_associated_entity_id,
OBJECT_NAME(p.object_id) AS object_name,
tl.request_status,
tl.request_mode,
tl.request_session_id,
tl.resource_description
FROM sys.dm_tran_locks tl
LEFT JOIN sys.partitions p
ON p.hobt_id = tl.resource_associated_entity_id
WHERE tl.resource_database_id = DB_ID()
AND p.object_id IS NOT NULL