Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 List of Logins & users using T-sql

Author  Topic 

ramaiah
Starting Member

27 Posts

Posted - 2010-02-17 : 10:28:13
hi,

how i can get the all logins, Server roles, mapping database and database roles using t-sql.

how i can get the all databases, users and database roles using t-sql.

thanks in advance

regards
ram.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-17 : 10:49:25
use
sys.server_principals
http://msdn.microsoft.com/en-us/library/ms188786.aspx
and sys.sql_logins
http://msdn.microsoft.com/en-us/library/ms174355.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -