Home > Catalog Views, SQLServer, SQLServer 2005, SQLServer 2008, SQLServer 2008 R2 > Using Catalog Views – sys.server_principals

Using Catalog Views – sys.server_principals


sys.server_principals contains all logins created on the server. It also contains server roles. Some of the columns returned by sys.server_principals are as below:

1. Name – Login Name,

2. Principal_id – Id number of the principal object,

3. Sid – Security Identifier of the login. In case of Windows mapped logins, this will be same as SID in Active Directory,

4. Type – Type of login – S = SQL Login, U = Windows Login, G = Windows Security Group Login, R = Server-role, C = Certificate mapped Login, K = Asymmetric Key mapped login,

5. Type_desc – Textual description of 'Type',

6. Is_disabled – 1 = Disabled,

7. Create/Modify_date – Creation / Modification date for login,

8. Default_database_name – Default database context for the login.

 

— © 2011 – Vishal (http://SqlAndMe.com)

 

SELECT name, principal_id, sid, type, type_desc, is_disabled,

       create_date, modify_date, default_database_name

FROM   sys.server_principals

Partial Result Set:

image

 

Hope This Helps!

Vishal

  1. No comments yet.
  1. No trackbacks yet.