Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.database_principals

  No additional text.


Syntax
CREATE VIEW sys.database_principals AS
	SELECT u.name,
		u.id AS principal_id,
		u.type,
		n.name AS type_desc,
		u.dfltsch AS default_schema_name,
		u.created AS create_date,
		u.modified AS modify_date,
		r.indepid AS owning_principal_id,
		u.sid,
		sysconv(bit, case when u.id >= 16384 and u.id < 16400 then 1 else 0 end) AS is_fixed_role
	FROM sys.sysowners u
	LEFT JOIN sys.syssingleobjrefs r ON r.depid = u.id AND r.class = 51 AND r.depsubid = 0	-- SRC_ROLEOWNER
	LEFT JOIN sys.syspalnames n ON n.class = 'USTY' AND n.value = u.type
	WHERE u.type <> 'L'
		AND has_access('US', u.id) = 1	-- PR_ALIAS

 
Last revision 2008RTM
See also

  spt_column_privileges_set_view (View)
spt_table_privileges_view (View)
sp_addalias (Procedure)
sp_addapprole (Procedure)
sp_adddistributiondb (Procedure)
sp_addrole (Procedure)
sp_addrolemember (Procedure)
sp_addsynctriggerscore (Procedure)
sp_cdc_drop_objects (Procedure)
sp_cdc_verify_role_name (Procedure)
sp_changegroup (Procedure)
sp_changeobjectowner (Procedure)
sp_check_removable_sysusers (Procedure)
sp_column_privileges (Procedure)
sp_dbfixedrolepermission (Procedure)
sp_dbmmonitorupdate (Procedure)
sp_droprolemember (Procedure)
sp_dts_deletepackage (Procedure)
sp_dts_getpackage (Procedure)
sp_dts_getpackageroles (Procedure)
sp_dts_putpackage (Procedure)
sp_dts_setpackageroles (Procedure)
sp_enum_login_for_proxy (Procedure)
sp_grantdbaccess (Procedure)
sp_grant_publication_access (Procedure)
sp_helpdbfixedrole (Procedure)
sp_helpgroup (Procedure)
sp_helplogins (Procedure)
sp_helpntgroup (Procedure)
sp_helprole (Procedure)
sp_helprolemember (Procedure)
sp_helpuser (Procedure)
sp_link_publication (Procedure)
sp_mergemetadataretentioncleanup (Procedure)
sp_MSacquireHeadofQueueLock (Procedure)
sp_MSacquireSlotLock (Procedure)
sp_MSallocate_new_identity_range (Procedure)
sp_MScreate_dist_tables (Procedure)
sp_MSdropmergepalrole (Procedure)
sp_MSdroptranpalrole (Procedure)
sp_MSensure_single_instance (Procedure)
sp_MSgetmakegenerationapplock (Procedure)
sp_MSgetmakegenerationapplock_90 (Procedure)
sp_MSmakegenerationidentity (Procedure)
sp_MSmergepublishdb (Procedure)
sp_MSprocesspublisherlink (Procedure)
sp_MSpublishdb (Procedure)
sp_MSreleasemakegenerationapplock (Procedure)
sp_MSremovedbreplication (Procedure)
sp_MSreplcheck_pull (Procedure)
sp_MSrepltrigcertgrant (Procedure)
sp_MSrepl_dbrole (Procedure)
sp_MSrepl_drop_all_role_members (Procedure)
sp_MSrepl_FixPALRole (Procedure)
sp_MSrepl_FixTranPALRole (Procedure)
sp_MSscript_begintrig1 (Procedure)
sp_revoke_login_from_proxy (Procedure)
sp_revoke_publication_access (Procedure)
sp_ssis_deletepackage (Procedure)
sp_ssis_getpackage (Procedure)
sp_ssis_getpackageroles (Procedure)
sp_ssis_putpackage (Procedure)
sp_ssis_setpackageroles (Procedure)
sp_sysutility_mi_configure_proxy_account (Procedure)
sp_sysutility_ucp_provision_proxy_account (Procedure)
sp_unlink_publication_internal (Procedure)
sp_verify_login_identifiers (Procedure)
sysmail_help_principalprofile_sp (Procedure)
sysmail_verify_principal_sp (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