How can a non admin user check if the current database is in use, i.e. if he is the only user connected to the database?

  • Hi,

    I would like to know if it is possible for a non admin user to know if he is the only user connected to the current database. I don't want to know who is connected but only that there is someone else connected (a YES or NO is enough). Furthermore, I would like to do that without changing any permissions (EX: VIEW SERVER STATE).

    One of my problem is that the master.dbo.sysprocesses table can only be accessed by the role "sysadmin" to see all the information. Otherwise, the non admin user will see only his info, so he thinks he is the only one connected... :crying:

    Please help

  • You could create a proc or view that would return the correct information, then give permissions on that proc or view.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • That's what I tried but I don't know want to put in the stored proc... :blush:

    All my tries never return the info about other connections for a non admin user.

  • You can use EXECUTE AS to specify an account that has the required permissions and then grant execute permissions to your user.

    Note: Trustworthy ON is necessary!!


    * Noel

Viewing 4 posts - 1 through 4 (of 4 total)

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