Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

using sys.dm_exec_sessions , where to find database name/id Expand / Collapse
Author
Message
Posted Monday, January 7, 2013 11:42 AM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, October 11, 2016 9:44 AM
Points: 1, Visits: 177
This query (joining sys.dm_exec_sessions to sys.dm_exec_requests) is functionally different from querying sys.sysprocesses.

sys.sysprocesses has the current database context for every session (regardless of whether there are any currently-executing requests).
However, joining to sys.dm_exec_requests means that you will only get results for sessions with currently-executing requests.

You'll get fewer roes using sys.dm_exec_requests, and potentially filter out valid results.

As of now, I think that the dbid data in sys.sysprocesses is uniquely available in that view, and not available in any other 2012 DMV.
Post #1403786
Posted Tuesday, September 8, 2015 1:07 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, September 8, 2015 1:06 PM
Points: 1, Visits: 71
sys.dm_exec_requests will show only the currently executing processes not the one waiting for connections
Post #1717867
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse