sql server 2000: limiting user session time

Réponse proposée sql server 2000: limiting user session time

  • mardi 7 août 2012 13:25
     
     

    how to limit a user sessions time connecting to the database, for example the user connecting to the database from the application gets it session expired after 30 minutes. how to do it?

Toutes les réponses

  • mardi 7 août 2012 17:02
    Auteur de réponse
     
     Réponse proposée

    Hello,

    This is something you'll want to do outside of SQL Server. It sounds like you're using IIS or some type fo web app, which is where the session timeout should be set.

    The only way to "expire" a session is to kill the spid associated with it... which I wouldn't do!

    -Sean


    Sean Gallardy, MCC | Blog

  • mercredi 8 août 2012 06:12
     
     
    i agree this is something which should be done from the application side, but if i had to implement from database side, how would i be doing it in sql server 2000??
  • mercredi 8 août 2012 06:33
     
     
    In SQL Server there is not option to limit the session time.

    Olaf Helper
    * cogito ergo sum * errare humanum est * quote erat demonstrandum *
    Wenn ich denke, ist das ein Fehler und das beweise ich täglich
    Blog Xing

  • mercredi 8 août 2012 06:52
     
     

    what if i schedule a procedure which checks for the users session's elapsed time and kill the session if it is more then 30 minutes or so.

    i know it's not recommended.any thought on it?

    ==================================================================================

    in sql server 2008 i refer to sys.dm_exec_sessions but it's not their in sql server 2000, which table i should refer to? 

    ==================================================================================

  • mercredi 8 août 2012 07:12
     
      A du code

    in sql server 2008 i refer to sys.dm_exec_sessions but it's not their in sql server 2000, which table i should refer to

    In SQL Server 2000 you could use "sysprocesses"

    SELECT *
    FROM dbo.sysprocesses

    But you should be very carefully, that you don't kill a system process, which could crash you complete SQL Server.

    Olaf Helper
    * cogito ergo sum * errare humanum est * quote erat demonstrandum *
    Wenn ich denke, ist das ein Fehler und das beweise ich täglich
    Blog Xing

  • mercredi 8 août 2012 08:56
     
     

    thanks for ur view,

     

    for being careful i selected only the session id which have the values more then 50, so only spid's i will be having will be user process