Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • plan10g.sql good1 Oracle
  • upload.html PHP/MYSQL/Wordpress
  • Good links for x$ tables in oracle. Oracle
  • Find_stale_dr.sql finding stale physical DR.. 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
  • Find Time Consuming SQL Statements in Oracle 10g Oracle
  • First Entry in RAC Oracle
  • Add new columns in dataframe Python/PySpark
  • Display the top 5 salaries for each department using single SQL Oracle
  • Reading config file from other folder inside class Python/PySpark
  • Move WordPress site from one hosting service to other. PHP/MYSQL/Wordpress
  • RAC with RHEL4 and 11g Oracle
  • v$backup.status information Oracle
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • Implementing Listener Security 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
  • Check SQL Server edition SQL Server
  • T-SQL Vs PL/SQL Syntax SQL Server
  • SQL Server Vs Oracle Architecture difference SQL Server
  • SQL Server: How to see historical transactions 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)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Remove DOS CR/LFs (^M) Linux/Unix
  • How to Make Trace Files Created by Oracle Readable by All Users ? Oracle
  • findobj.sql Oracle
  • SYSOPER Mystery Oracle
  • Temporary Tablespace Information and restriction. Oracle
  • findinfo.sql (SQL for getting CPU and Active session info) Oracle
  • When error comes for temporary tablespace with version <= 9i Oracle
  • oracle 10g on linux Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme