current connection for specific database

  • Hi Everyone,

    I have a shared Sql instance having multiple databases of different Departments.

    I have created a login LoginDept1 and given db_owner permission on database Dept1Db

    The development team wants to see current connections for Dept1db by login LoginDept1.

    As i know one way of doing this is giving View_server_state permission ,but i dont want to give View_server_state permission.

    My question is what permission will be required to give . What may be ways to complete this task.

    -----------------
    Aditya Rathour
    SQL DBA

    Not Everything that is faced can be changed,
    but nothing can be changed until it is faced.

  • aprathour.89 (4/30/2015)


    Hi Everyone,

    I have a shared Sql instance having multiple databases of different Departments.

    I have created a login LoginDept1 and given db_owner permission on database Dept1Db

    The development team wants to see current connections for Dept1db by login LoginDept1.

    As i know one way of doing this is giving View_server_state permission ,but i dont want to give View_server_state permission.

    My question is what permission will be required to give . What may be ways to complete this task.

    Quick thought, create a procedure that queries the sys.dm_exec_sessions with "execute as" and filter on the user.

    😎

  • Thanks Eirikur Eiriksson

    It works.

    -----------------
    Aditya Rathour
    SQL DBA

    Not Everything that is faced can be changed,
    but nothing can be changed until it is faced.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply