sp_who2 shows wrong value of hostname and login for a spid

  • I am connected to a SQL server using windows auth.

    My query window was open for a whole day but active (not disconnected).

    It's spid (as seen in bottom right of SSMS) is 61.

    When I ran sp_who2 61 from a new query window on same server, it showed some other hostname and login than mine.

    Anyone else experience this ?

    Can two processes share a spid ?

    Is SSMS showing wrong spid for current query, or is sp_who2 showing wrong data ?

  • I know you explicitly said same server, but that's too weird.

    so theres no chance you are in a multi server environment, and the window you look at is test/development, but the sp_who2 was run on production?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Are you sure that spid was still active?



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • @lowell,

    I thought I was going crazy / blind too.

    So had a colleague look at my screen while i hit the NEW-QUERY button (which by default opens a same server-db connection),

    we explicitly checked it was on the same server & login,

    then ran sp_who2 61, and it showed a front-end's hostname, rather than my laptop name.

    @Alvin,

    Yes, I was actively running queries from that window, a minute before I checked sp_who2.

    The only thing I can imagine is, since I had the connection open for a while, maybe SQL or SSMS was showing me the wrong spid..

  • The only thing I can imagine is, since I had the connection open for a while, maybe SQL or SSMS was showing me the wrong spid..

    This would make sense.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • I'd try SELECT @@SPID as well as selecting from sys.dm_exec_requests, sys.dm_exec_connections (I think) to see what's there.

    Still sounds a little odd.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 6 posts - 1 through 5 (of 5 total)

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