GRANT Server Principal Permissions (Transact-SQL)
Grants permissions on a SQL Server login.
Permissions at the server scope can be granted only when the current database is master.
Information about server permissions is visible in the sys.server_permissions catalog view. Information about server principals is visible in the sys.server_principals catalog view.
A SQL Server login is a server-level securable. The most specific and limited permissions that can be granted on a SQL Server login are listed in the following table, together with the more general permissions that include them by implication.
SQL Server login permission | Implied by SQL Server login permission | Implied by server permission |
|---|---|---|
CONTROL | CONTROL | CONTROL SERVER |
IMPERSONATE | CONTROL | CONTROL SERVER |
VIEW DEFINITION | CONTROL | VIEW ANY DEFINITION |
ALTER | CONTROL | ALTER ANY LOGIN |
A. Granting IMPERSONATE permission on a login
The following example grants IMPERSONATE permission on the SQL Server login WanidaBenshoof to a SQL Server login created from the Windows user AdvWorks\YoonM.
USE master; GRANT IMPERSONATE ON LOGIN::WanidaBenshoof to [AdvWorks\YoonM]; GO
B. Granting VIEW DEFINITION permission with GRANT OPTION
The following example grants VIEW DEFINITION on the SQL Server login EricKurjan to the SQL Server login RMeyyappan with GRANT OPTION.
USE master;
GRANT VIEW DEFINITION ON LOGIN::EricKurjan TO RMeyyappan
WITH GRANT OPTION;
GO
