Help filtering user connection with sp_who

  • Good night

    In new in sqlserver, its a simple question

    when i type sp_who, displays all user, connections and processess in an instance in sqlserver

    but when i filter a specific user i.e. sp_who '\TRAFICO\production' the resulset or output is in blank, just the name of the columns like spid,ecid,loginame,hostname, etc.

    1. Why?

    2. How can i filter with this specific user showing all proceses fior that user?

    Thanks for your reply

  • Try it like this:

    sp_who 'TRAFICO\production'

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • i tried it without success, and this is the user; otherwise the output would be

    "The login 'TRAFICO\production' doesn exist', but it really exists

    The problem is that in the resulset apears nothing just the headings of the columns like SPID, ECID, etc and the processes asociated with this user are not shown.

    what can i do? and why is not showing anything?

    I'd appreciate your help

  • Are you sure that anyone is logged in with that username?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • yes, I'm sure, because initially with sp_who displays all the inforamation with users, connection and processes, and i click right on this specific user (copy and paste this user as parameter in sp_who), so there's no way to get wrong or mistype.

  • Hi,

    May be you can try querying the "sysprocesses" table filtering on the nt_domian/nt_username columns. If user is logged in, it should return the corresponding rows.

    [font="Verdana"]Renuka__[/font]

  • You can also see the code in the master database. I thought that 'domain\user' would work, but perhaps it's user in the database and not login.

  • My personal suspicion is that there is some unprintable character in their Domain Login Name. Try what Renuka said: try to find them in SysProcesses, if you can and then save their Login Name into a variable and then use that as an argument to SP_WHO.

    If you have the same trouble selecting their record in SysProcesses, try using LIKE with wildcards and only part of their name.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

Viewing 8 posts - 1 through 7 (of 7 total)

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