Up until now, all the applications I have worked on have been for use within the company, so we have not had to worry about licensing for the app itself. We are now building a commercial application and would like to restrict the number of application users connecting to the database.
We have created a secure license file client side which contains the number of licensed users (e.g. 20), and I was using the following query to check how many users were connected each time the app started:
This works well, until a user leaves their application running but not doing anything. After a period of time, their process ID drops from sysprocesses and they will not be counted when another user starts their copy of the application.
Is there a way to prevent this, other than checking the number of connected users every time a query is run from the application ?
We have created a secure license file client side which contains the number of licensed users (e.g. 20), and I was using the following query to check how many users were connected each time the app started:
Code:
SELECT COUNT(*) FROM sysprocesses WHERE SUBSTRING(db_name(dbid),1,30) = 'DatabaseName'
Is there a way to prevent this, other than checking the number of connected users every time a query is run from the application ?