Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Good Link from metalink 1 Oracle
  • TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1 Oracle
  • fuser to check who is using diretory Linux/Unix
  • Find all users who have DML privileges Oracle
  • find_log_switch.sql Find log switches in graphical manner Oracle
  • Follwoing korn shell is used to move files from source folder to destination folder and gzip it in destination folder. mv_iotto.ksh Linux/Unix
  • Rman Notes -1 Oracle
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle
  • export import with parameter file. Oracle
  • pvm_pre_change.sql Oracle
  • Rman Notes -1 Oracle
  • Oracle Data Direct to TAPE Oracle
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • proper cpu stats Linux/Unix

SQL Server: How to see current transactions or requests

Posted on 25-Jul-202525-Jul-2025 By Admin No Comments on SQL Server: How to see current transactions or requests

To check if there are any active transactions in SQL Server, you have several tools at your disposal depending on how deep you want to inspect.


✅ Option:1 See Transactions via sys.dm_tran_active_transactions

SELECT * FROM sys.dm_tran_active_transactions;


This gives you raw info about each active transaction, including internal ones. Focus on transaction_type:
ValueType
1Read/write transaction
2Read-only transaction
3System transaction
4Distributed transaction

✅ Option:2 See Transactions by Session (sp_who2 or sys.dm_exec_requests)

EXEC sp_who2;


Look at sessions where BlkBy <> '' or Status = 'RUNNABLE' / 'SUSPENDED'.

OR

SELECT
    session_id,
    status,
    command,
    wait_type,
    blocking_session_id,
    transaction_id
FROM sys.dm_exec_requests
WHERE transaction_id IS NOT NULL;

✅ Option:3 Check Transaction Count in Current Session

If you want to check if your own session has open transactions:

SELECT @@TRANCOUNT AS OpenTransactions;

✅ Option 4: DBCC OPENTRAN (Old but Useful)

To see the oldest active transaction in a specific database:

USE YourDBName;
DBCC OPENTRAN;

This is great for identifying long-running or stuck transactions.


🚦 Common Scenarios to Investigate:

SymptomPossible Cause
Blocking / DeadlocksUncommitted transactions
Long-running queriesTransactions not committed
Replication lagUncommitted open transactions
TempDB pressureLarge transaction rollbacks

SQL Server

Post navigation

Previous Post: T-SQL Vs PL/SQL Syntax
Next Post: SQL Server: How to see historical transactions

Related Posts

  • SQL Server: How to see historical transactions SQL Server
  • Check SQL Server edition SQL Server
  • T-SQL Vs PL/SQL Syntax SQL Server
  • Checking SQL Server Version SQL Server
  • SQL Server Vs Oracle Architecture difference SQL Server

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (150)
  • MYSQL (5)
  • Oracle (403)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (151)
  • SQL scripts (349)
  • SQL Server (6)
  • Uncategorized (5)
  • Videos (0)

Recent Posts

  • Key Management in Oracle: The Core Issue: Missing Master Key12-May-2026
  • SAT Mathematics 10 questions and answer at the end.30-Apr-2026
  • top 10 AI news today30-Apr-2026
  • runon_allpdbs_show_conname.sh23-Apr-2026
  • runon_allcdbs_find_pdbs.sh23-Apr-2026
  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Python class import from different folders Python/PySpark
  • Complete Git Tutorial for Beginners GIT
  • xargs use Linux/Unix
  • top 10 AI news today Uncategorized
  • Read CSV file using PySpark Python/PySpark
  • tar and untar a dolder with all its subfolder. Linux/Unix
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle
  • copying/removing directory with all its subdirectory Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme