Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.syslogins

  No additional text.


Syntax
CREATE VIEW sys.syslogins AS SELECT
	sid = p.sid,
	status = convert(smallint, 8 +
		CASE WHEN m.state in ('G','W') THEN 1 ELSE 2 END),
	createdate = p.create_date,
	updatedate = p.modify_date,
	accdate = p.create_date,
	totcpu = convert(int, 0),
	totio = convert(int, 0),
	spacelimit = convert(int, 0),
	timelimit = convert(int, 0),
	resultlimit = convert(int, 0),
	name = p.name,
	dbname = p.default_database_name,
	password = convert(sysname, LoginProperty(p.name, 'PasswordHash')),
	language = p.default_language_name,
	denylogin = convert(int, CASE WHEN m.state ='D' THEN 1 ELSE 0 END),
	hasaccess = convert(int, CASE WHEN m.state in ('G','W') THEN 1 ELSE 0 END),
	isntname = convert(int, CASE WHEN p.type in ('G','U') THEN 1 ELSE 0 END),
	isntgroup = convert(int, CASE WHEN p.type='G' THEN 1 ELSE 0 END),
	isntuser = convert(int, CASE WHEN p.type='U' THEN 1 ELSE 0 END),
	sysadmin = convert(int, ISNULL ((SELECT 1 FROM sys.server_role_members WHERE member_principal_id = p.principal_id
		AND role_principal_id = 3), 0)), --x_MDLoginIdSysAdmin
	securityadmin = convert(int, ISNULL ((SELECT 1 FROM sys.server_role_members WHERE member_principal_id = p.principal_id
		AND role_principal_id = 4), 0)), --x_MDLoginIdSecAdmin
	serveradmin = convert(int, ISNULL ((SELECT 1 FROM sys.server_role_members WHERE member_principal_id = p.principal_id
		AND role_principal_id = 5), 0)), --x_MDLoginIdServAdmin
	setupadmin = convert(int, ISNULL ((SELECT 1 FROM sys.server_role_members WHERE member_principal_id = p.principal_id
		AND role_principal_id = 6), 0)), --x_MDLoginIdSetupAdmin
	processadmin = convert(int, ISNULL ((SELECT 1 FROM sys.server_role_members WHERE member_principal_id = p.principal_id
		AND role_principal_id = 7), 0)), --x_MDLoginIdProcAdmin
	diskadmin = convert(int, ISNULL ((SELECT 1 FROM sys.server_role_members WHERE member_principal_id = p.principal_id
		AND role_principal_id = 8), 0)), --x_MDLoginIdDiskAdmin
	dbcreator = convert(int, ISNULL ((SELECT 1 FROM sys.server_role_members WHERE member_principal_id = p.principal_id
		AND role_principal_id = 9), 0)), --x_MDLoginIdDBCreator
	bulkadmin = convert(int, ISNULL ((SELECT 1 FROM sys.server_role_members WHERE member_principal_id = p.principal_id
		AND role_principal_id = 10), 0)), --x_MDLoginIdBulkAdmin
	loginname = p.name
FROM sys.server_principals p LEFT JOIN master.sys.sysprivs m
	ON m.class = 100 AND m.id = 0 AND m.subid = 0 AND m.grantee = p.principal_id AND m.grantor = 1 AND m.type = 'COSQ'
WHERE p.type <> 'R'

 
Last revision 2008RTM
See also

  sp_adddistributor (Procedure)
sp_addsynctriggerscore (Procedure)
sp_adduser (Procedure)
sp_change_users_login (Procedure)
sp_create_log_shipping_monitor_account (Procedure)
sp_dropdistributor (Procedure)
sp_droplogin (Procedure)
sp_dropsrvrolemember (Procedure)
sp_dropuser (Procedure)
sp_grant_publication_access (Procedure)
sp_helplogins (Procedure)
sp_help_publication_access (Procedure)
sp_link_publication (Procedure)
sp_MSaddlogin_implicit_ntlogin (Procedure)
sp_MScheck_pull_access (Procedure)
sp_MSloginmappings (Procedure)
sp_MSprocesspublisherlink (Procedure)
sp_MSpublication_access (Procedure)
sp_MSreplcheck_pull (Procedure)
sp_MSrepl_DistDBPALAccess (Procedure)
sp_MSscript_begintrig1 (Procedure)
sp_oledb_defdb (Procedure)
sp_oledb_deflang (Procedure)
sp_password (Procedure)
sp_resolve_logins (Procedure)
sp_sqlagent_has_server_access (Procedure)
sp_sysutility_mi_configure_proxy_account (Procedure)
sp_sysutility_ucp_provision_proxy_account (Procedure)
sp_update_job (Procedure)
sp_validatelogins (Procedure)
sp_verify_job (Procedure)
sp_verify_schedule (Procedure)
sp_who2 (Procedure)
xp_logininfo (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash