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:16 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 4, 2014 2:41 PM
Points: 4, Visits: 21
Apologies for the repost. I may have posted in the incorrect (SQL Server 2005 General Discussion) forum.

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 #1522831
Posted Friday, December 13, 2013 12:23 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 4:43 AM
Points: 12,895, Visits: 32,090
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1522833
Posted Friday, December 13, 2013 12:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 4, 2014 2:41 PM
Points: 4, Visits: 21
Thank you Lowell!

Tell me how to give you points and I will. =]
Post #1522835
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse