idle users connected to the server in sql server 2005 snt edition
hi team, i have executed the below query select * from sys.dm_exec_sessions where dateadd(hour, 2, last_request_end_time) < getdate() order by last_request_end_time desc and found that more than 300 users are connected to the server,who are purely idle,.my question it that what is the saffest way to delete them, i am thinking to use this command ***alter database DbaWorks set online with no_wait*** is there any other best to to kill idle users
I wouldn't necessarily remove the connections. It might just be connection pooling waiting for the next round to come through. As long those connections aren't holding locks and there are only a few of them (300 isn't much), I wouldn't sweat it necessarily. If they're holding locks or the number escelates by quite a bit, then you have cause for serious concern.
Same advice - I would only kill connections that had been idle for a lengthy period of time. The length of time depends on the database and application - thus one should understand those things. Be careful before trying to kill any connections. It is well worth it to gain an understanding of the app and the database before killing these connections.