Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Drop database in Oracle 10g Oracle
  • Some OS level threshold for performance. Linux/Unix
  • sid_wise_sql.sql Further explaination Oracle
  • Zip and unzip with tar Linux/Unix
  • move_arch_files.ksh /* Good One */ Linux/Unix
  • Find All internal Parameters Oracle
  • plan10g.sql Oracle
  • v$event_name Oracle
  • DBA_HIST_SQLSTAT contents Oracle
  • Good link for LIO in Oracle ( Logical IOs) Oracle
  • Adding or Dropping Online Redo Log Files When Physical Standby in place Oracle
  • Guide to Linux System Command Mastery Linux/Unix
  • Standby Database File Management in 10g with STANDBY_FILE_MANAGEMENT Oracle
  • compile_inv.sql Oracle
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle

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

  • Checking SQL Server Version SQL Server
  • SQL Server: How to see historical transactions SQL Server
  • T-SQL Vs PL/SQL Syntax SQL Server
  • Check SQL Server edition 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 (149)
  • MYSQL (5)
  • Oracle (397)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (345)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • track_autoupgrade_copy_progress.sql01-Apr-2026
  • refre.sql for multitenant01-Apr-2026
  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • TNSNAMES entries details Oracle
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • Import and export statements Oracle
  • How to find the real execution plan and binds used in that explain plan in Oracle 10g?? Oracle
  • moving lob object to other tablespace lob_mvmt.sql Oracle
  • Privileges Required to Create Procedures and Functions that uses objects from other schema. Oracle
  • tar and untar a dolder with all its subfolder. Linux/Unix
  • Error Handling in Proc Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme