How to get a list of all users with sa privilege?

  • I mean how to get a list of all users with sa privilege, not manually?

  • USE master

    SELECT name FROM syslogins WHERE sysadmin 1

    John

  • Thank you for your input. It works. A weird result was found when I run

    SELECT * FROM master..syslogins WHERE sysadmin = 1

    Look at the value at sysadmin!

  • And now you have a proof... 1 = 0.  Looks like those users were right all along .

  • I have not finished my coffee yet ... what am I missing here ?

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • SELECT * FROM master..syslogins WHERE sysadmin = 1

     

    Check out the third line >> SysAdmin = 0

  • I just spot checked 4 of my 25 servers and did not find Sysadmin=0 in the query results ...

    I'm on my second cup of coffee as well ...

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • Must have been fixed with a Service pack... can't say I installed of 'em on my dev machine !

  • My SQL version is 2000 (8.00.2039). When I used grid for output, I found the weird output. When I used text for out, everything was going fine.

     

  • Very interesting ... I have been able to duplicate it when using grid for output instead of text. It only occurs for SQL logins with the sysadmin role, not NT logins. I am on 8.00.818 across the board (SP3 w/hotfix 818).

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

Viewing 10 posts - 1 through 9 (of 9 total)

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