RE: User restricted to a single Login/Session

From: Jivko Dobrev [MS] (jivkod@online.microsoft.com)
Date: 07/06/02


From: jivkod@online.microsoft.com (Jivko Dobrev [MS])
Date: Fri, 05 Jul 2002 23:55:53 GMT


Hello Tricia,

Interesting problem, indeed. You could implement some restriction from
within SQL, but it will be inefficient and unsupported. For instance, you
could define a job, which queries the sysprocesses every minute and if it
discovers more than one process for the specified user, to kill all the
user's processes except the first one. This would probably discorage the
user from opening many times the application, but it is neither supported,
nor efficient.

The better way to apply the connections restriction is to slightly modify
the client application to disallow opening more than 1 instance of it.
Simply in the program entry point, include a verification if a process with
the application's name already exists and if so, exit gracefully. This
would prevent more than 1 instance of the application from starting.

Hope that this information will be useful for you.
Have a wonderful day!
Jivko Dobrev

This posting is provided "AS IS" with no warranties, and confers no rights.