search for something in a row

  • Hi,

    i need to find if exists this username and hostname in the sys.sysprocesses but i need to find if it exists in any row not in the columns.

    for example - i need to find if in the sys.sysprocesses rows there is a loginame = mike and hostname = computer,not in columns loginame or hostname.

    THX

  • What columns would those be in other than the ones you don't want?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • i don't understand what you are saying.

  • Certain data is in sysprocesses, and the user "mike" could only be in certain columns, not any column.

    So your question doesn't make sense.

  • select

    *

    from master..sysprocesses

    Where loginame like 'MIKE%'

    and HOSTNAME like 'your hostname'

    only the columns that you can dig down for a Login are:

    NT_USERNAME,LOGINAME AND HOSTNAME for yourHostName

  • i think that i can manager with the code.

    but how can i catch the hostname when a user is login to the SQL with the DDL Trigger logon event?

    if i use the ClientHost option i get the ip address of that machine,i need the netbios name of that machine because i compare it with the hostname column in the sys.sysprocesses

    THX

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

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