Results 1 to 5 of 5

Thread: way to show user name when they are sysadmin

  1. #1
    Join Date
    Nov 2002
    Posts
    261

    way to show user name when they are sysadmin

    Is it possible to show the user name (such as 'phuser') who is a member of the sysadmin group (NOT my idea!) I notice if you go to current connections is SQL EM the name shows, but if I login as that user if I try, user, user_name, etc inside of QA it shows DBO

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Do you mean current activity?

    You can get similar information in Query Analyzer by running sp_who2

  3. #3
    Join Date
    Sep 2002
    Posts
    5,938
    You can try this

    IS_SRVROLEMEMBER ( 'sysadmin' [ , 'login' ] )

  4. #4
    Join Date
    Mar 2003
    Location
    NJ
    Posts
    201
    select name,* from master..syslogins where sysadmin = 1

  5. #5
    Join Date
    Nov 2002
    Posts
    261
    I appreciate the help, what I need to actually do is create a trigger which will not allow this user to insert a record into a table. I tried to use a deny against that user , but sinde they are sysadmins they still can. i was going to try to write a trigger which identifies this specific user to roll back the insert

Posting Permissions

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