Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2004
    Posts
    39

    Unanswered: limit the no. of users

    I have an application that uses a small SQL Server database.
    What I need is to prevent the access of an amount of users to the database.
    At the beginning I want to limit the access only for 2 users but I want to be able in the future to grant the access to more.

  2. #2
    Join Date
    Jun 2003
    Posts
    269
    u can limit no: of concurrent users at server level,but U cant limit no: of user at database level from sql server.
    I love cursor,though I never use it.Cos' I dont want to misuse it.
    ----------------------------------------------

    ----cheers
    ----http://mallier.blogspot.com

  3. #3
    Join Date
    Nov 2004
    Posts
    39
    Actually, I want only 2 users to be able to use my application at the same time and I cant figure out which is the best solution to implement this.

  4. #4
    Join Date
    Jun 2003
    Posts
    269
    what kind of application is that? web based or windows based?
    Is that application is installed on each computer or shared thru network if it is windows based?
    I love cursor,though I never use it.Cos' I dont want to misuse it.
    ----------------------------------------------

    ----cheers
    ----http://mallier.blogspot.com

  5. #5
    Join Date
    Nov 2004
    Posts
    39
    It's a windows client-server application.
    I am thinking of giving a session ID when a user log in. Every time the client uses the database I'll check the session ID if is valid.
    When the client try to log in the 2nd time I'll give him another Session ID and I'll destroy the other one.
    I have also to limit the session ID numbers to 2 for the beginning and I'll ignore users that are not in the top 2.
    What do u thinck about this?

  6. #6
    Join Date
    Feb 2003
    Location
    India
    Posts
    216
    the solution you suggested will work, but the problem with it is - it requires maintenance module to manually disconnect users those who have accidentally or by mistake closed the application/machine without proper logout.

    SQL server allows you to create unique application objects and lock them during execution. I think that can be an alternative solution to the problem. check sp_getapplock on BOL. the best thing is - it automatically releases the lock as soon as the connection is lost.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •