Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Select ALL logins, users, and user groups shown in SSMS Security > Logins Expand / Collapse
Author
Message
Posted Friday, December 13, 2013 12:02 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 04, 2014 2:41 PM
Points: 4, Visits: 21
I want to select all logins, users, and user groups that are shown in the Security > Logins folder in SSMS.

I run this command:
select * from sys.sql_logins
select * from sysusers

The folder in SSMS has 66 items, but the query only returns 14 and 22 rows, even including things not shown in the folder such as db_owner, db_accessadmin, etc.
Post #1522828
Posted Friday, December 13, 2013 12:42 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 04, 2014 2:41 PM
Points: 4, Visits: 21
Apologies if I posted in the incorrect forum.

I don't see a way to delete the post so I'll just post the answer from the other forum:

select * from sys.server_principals

that will have domain users, as well as all the built in users; the sql_logins is a limited view of that same data(WHERE type_desc = 'SQL_LOGIN').

Lowell
Post #1522844
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse