Security Stored Procedures (Transact-SQL)

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)yesAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

SQL Server supports the following system stored procedures that are used to manage security. Some of these stored procedures are deprecated but continue to be available to support backward compatibility. The topics for deprecated procedures will list their replacement.

sys.sp_add_trusted_assembly sp_addapprole (Deprecated)
sp_addlinkedserver sp_addlinkedsrvlogin
sp_addlogin (Deprecated) sp_addremotelogin (Deprecated)
sp_addrole (Deprecated) sp_addrolemember (Deprecated)
sp_addserver (Deprecated) sp_addsrvrolemember (Deprecated)
sp_adduser (Deprecated) sp_approlepassword (Deprecated)
sp_audit_write sp_change_users_login
sp_changedbowner sp_changeobjectowner (Deprecated)
sp_control_dbmasterkey_password sp_dbfixedrolepermission (Deprecated)
sp_defaultdb (Deprecated) sp_defaultlanguage (Deprecated)
sp_denylogin (Deprecated) sp_describe_parameter_encryption
sp_dropalias (Deprecated) sys.sp_drop_trusted_assembly
sp_dropapprole (Deprecated) sp_droplinkedsrvlogin
sp_droplogin (Deprecated) sp_dropremotelogin (Deprecated)
sp_droprole (Deprecated) sp_droprolemember (Deprecated)
sp_dropserver sp_dropsrvrolemember (Deprecated)
sp_dropuser (Deprecated) sp_grantdbaccess (Deprecated)
sp_grantlogin (Deprecated) sp_helpdbfixedrole
sp_helplinkedsrvlogin sp_helplogins
sp_helpntgroup sp_helpremotelogin (Deprecated)
sp_helprole sp_helprolemember
sp_helprotect (Deprecated) sp_helpsrvrole
sp_helpsrvrolemember sp_helpuser (Deprecated)
sp_migrate_user_to_contained sp_MShasdbaccess
sp_password (Deprecated) sp_refresh_parameter_encryption
sp_remoteoption (Deprecated) sp_revokedbaccess (Deprecated)
sp_revokelogin (Deprecated) sp_setapprole
sp_srvrolepermission (Deprecated) sp_testlinkedserver
sp_unsetapprole sp_validatelogins
sp_xp_cmdshell_proxy_account

See Also

System Stored Procedures (Transact-SQL)
Security Functions (Transact-SQL)