Inactive Sessions

  • Is there a way of querying the db to establish which sessions have been inactive for a specified length of time?

    When I look at the master.sysprocesses table it seems to have the last batch time equal to the query time although I'm sure that some of the users have probably just left themselves logged in and aren't doing anything.

    The point of this is to close connections which have been open and inactive for perhaps 1 hour.

    Thanks

  • last_batch in sysprocesses is the place to look. Try an experiment yourself. Open up a QA session and run sp_who. Then let it go idle for 15-20 minutes. Then open up another QA session and execute a query against master..sysprocesses and see what you can see. As to the 'why' your users show the same time for last_batch and query times being eqiual is another question. TYou could try the same experiment with the application as well and see what you can see.

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply