Current Users in the system

  • Hello,

    I'm new to SQL Server, but have a bit of Oracle experience.  I'm trying to write a query that will give me the number of users in my application, along with their logon time.  That way, an administrator can log on and see who's using the system and when they logged on.  The Oracle equivalent would be something like:

    select distinct(

    username), module, logon_time from v$session where UPPER(program) like '%MYPROGRAM%'

    Any help would be much appreciated.  Thanks.

  • There is a stored procedure called sp_MSget_current_activity in the master database which returns all the current activity on the server.  This would be a good place to start.  You can examine what the procedure does and then build your query using borrowed logic from there.

     

  • I buddy,

     

    If u want to know how many users are presently connected to ur SQL Server.

    The u can know it from a procedure called sp_who2 this will give u the name and client machine name through which user is connected.

    and tells u what particulat login person is doing on sql server.

     

    from

    Killer

  • Thanks a lot for the help, Killer.  That has what I need.

    Bob

Viewing 4 posts - 1 through 3 (of 3 total)

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