Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set session time limit on sql server 2008 user session

Status
Not open for further replies.
Jul 28, 2011
167
NG
Hi all,

I have an application (Microsoft Dynamics Nav 09) used in my organisation that sits on SQL Server 2008. Users connect to remotely from their systems and can sometimes stay idle for hours consuming user license on the app(I have to be checking from time to time to bounce idle user).

Now, what I'm looking at is to be able to set this as a time limit on the sql server 2008.

Is it possible and how?

Thanks.

____________________
Men put up a strong face just to cover their weaknesses...good!
But a smile makes them live longer....
Which would you choose?

Think about it.
 
So, you want to KILL the connection on the SQL Server for a specific user if they have had no activity for x number of minutes?

wb
 
Thanks wbodger.

Well, yes. However, I'd like it to be automatic. So When a user is idle (or have had no activity)
wbodger said:
for x number of minutes
, then
wbodger said:
KILL the connection on the SQL Server
 
And then the question is, can you not do this from the client?
 
Well, I can kill a connection from the my end as the administrator. But It still boils down to thesame thing...I'd have to do it manually from time to time. The challenge is that there is a possibility that I forget. Or that I'm not available to do it Or something generally goes wrong.

I basically want to know if it is possible from SQL end or not!

Thanks
 
You can issue the Kill command, though most recommend against that. There is a system stored procedure sp_who2 that has the LastBatch date for each current connection, you could probably look at that and figure out how to get what you want. From my understanding, though, the question is do you really want to kill the processes or just get alerted that they have been sitting idle for too long.

wb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top