Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: Thursday, September 18, 2014 6:15 AM
Points: 1, Visits: 78
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
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse