Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2007
    Posts
    24

    Unanswered: Display connected users

    Hi everyone,

    I have one Inventory system which is in VB6 and SQL Server 2000.
    In my database there is table of users and userrights.

    These are my application users. They are nothing to do with Windows users and SQL Server users. I am connecting to database using 'sa' login.

    Now I want to display all my online users. I tried with @@SPID to manage their but not getting the exact results.

    Thanks in advance.


    Riyaz

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    sp_who and sp_who2 will show you what machine names are connected under the hostname field.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Mar 2007
    Posts
    24
    Quote Originally Posted by Thrasymachus
    sp_who and sp_who2 will show you what machine names are connected under the hostname field.
    I dont want to dispplay machine names and Let me clear one things
    These are neither Windows Users nor SQL users.

    What can I do with machine names??

  4. #4
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    i think activity monitor will show you the user associated with each spid.

  5. #5
    Join Date
    Mar 2007
    Posts
    24
    How can I get the user list using activity monitor?

    I tried with @@SPID but I am getting wrong results.

  6. #6
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    activity monitor is getting it from master.dbo.sysprocesses. in particular:

    select spid, loginame from master.dbo.sysprocesses

    if you ever wonder how some tool is getting its information, just launch profiler and start clicking around in the tool. then you'll see all the sql that it's executing. Try it in SSMS and you'll soon see why it's not as snappy as it could otherwise be...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •