Login Count

  • hi Guys?

    is there any way to stop a user connecting to the same database simultaneously?

    i want to deny access to a user that is already connected to specific database and is trying to connect to the same database that he is currently connected to.

     

     

     

    Thanks.

     

    Eduardo vwc

  • I cannot figure out a simple solution. One possible way is to use event notification to monitor login event:

    CREATE EVENT NOTIFICATION Check_Login

       ON SERVER

       FOR AUDIT_LOGIN

       TO SERVICE 'YourServiceName', 'current database'

    You need to create the queue, the service, and a procedure that can be activated by the SSB when a message arrives into the queue. In the procedure, you can check the login and the database ID (sys.sysprocesses), if the user already has a connection, kill the the process (you can the SPID from the event message)

     

  • What's the entire problem?

  • Hi?

    Thanks for the reply guys.

    what i really want, is to prevent the users from logging in twice to the same database,

    EG: if i am logged in using Workstation A, and i try to log in from Workstation B with the same username/password and the same database.

    i want to give a message to the users, and tell them that they are already logged in.

      

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

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