mardi 3 mars 2015

How to list LOGIN + ROLE in SQL Server 2008?


I'm looking for an answer but i can't found. Just a lot of long scripts.


I need to list Login | Role ( sysadmin, dbcreator, etc ) but i can't find a table to join.


I have this for now:



SELECT name AS Login_Name, type_desc AS Account_Type
FROM sys.server_principals
WHERE TYPE IN ('U', 'S', 'G')
and name not like '%##%'
ORDER BY name, type_desc


I need another collum with the Role.


With table should I search for it?


Thanks.





Aucun commentaire:

Enregistrer un commentaire