msSQL Session running on database

To see witch session id, that run command against a database, you can run this:

SELECT session_id
FROM sys.dm_exec_sessions
WHERE database_id = db_id('DBName')

Leave a Reply

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