Partilhar via


Permissions

Every SQL Server 2005 securable has associated permissions that can be granted to a principal. This topic provides the following information:

  • Permissions naming conventions
  • Permissions related to specific securables
  • SQL Server 2005 permissions
  • Examples

Permissions Naming Conventions

The following describes the general conventions that are followed for naming permissions:

  • CONTROL
    Confers ownership-like capabilities on the grantee. The grantee effectively has all defined permissions on the securable. A principal that has been granted CONTROL can also grant permissions on the securable. Because the SQL Server security model is hierarchical, CONTROL at a particular scope implicitly includes CONTROL on all the securables under that scope. For example, CONTROL on a database implies all permissions on the database, all permissions on all assemblies in the database, all permissions on all schemas in the database, and all permissions on objects within all schemas within the database.
  • ALTER
    Confers the ability to change the properties, except ownership, of a particular securable. When granted on a scope, ALTER also bestows the ability to alter, create, or drop any securable that is contained within that scope. For example, ALTER permission on a schema includes the ability to create, alter, and drop objects from the schema.
  • ALTER ANY <Server Securable>, where Server Securable can be any server securable.
    Confers the ability to create, alter, or drop individual instances of the Server Securable. For example, ALTER ANY LOGIN confers the ability to create, alter, or drop any login in the instance.
  • ALTER ANY <Database Securable>, where Database Securable can be any securable at the database level.
    Confers the ability to CREATE, ALTER, or DROP individual instances of the Database Securable. For example, ALTER ANY SCHEMA confers the ability to create, alter, or drop any schema in the database.
  • TAKE OWNERSHIP
    Enables the grantee to take ownership of the securable on which it is granted.
  • IMPERSONATE <Login>
    Enables the grantee to impersonate the login.
  • IMPERSONATE <User>
    Enables the grantee to impersonate the user.
  • CREATE <Server Securable>
    Confers to the grantee the ability to create the Server Securable.
  • CREATE <Database Securable>
    Confers to the grantee the ability to create the Database Securable.
  • CREATE <Schema-contained Securable>
    Confers the ability to create the schema-contained securable. However, ALTER permission on the schema is required to create the securable in a particular schema.
  • VIEW DEFINITION
    Enables the grantee to access metadata.
  • BACKUP and DUMP are synonymous.
  • RESTORE and LOAD are synonymous.

Permissions Applicable to Specific Securables

The following table lists major genera of permissions and the kinds of securables to which they may be applied.

Permission Applies to

SELECT

Synonyms

Tables and columns

Table-valued functions, Transact-SQL and common language runtime (CLR), and columns

Views and columns

UPDATE

Synonyms

Tables and columns

Views and columns

REFERENCES

Scalar and aggregate functions (Transact-SQL and CLR)

SQL Server 2005 Service Broker queues

Tables and columns

Table-valued functions (Transact-SQL and CLR), and columns

Views and columns

INSERT

Synonyms

Tables and columns

Views and columns

DELETE

Synonyms

Tables and columns

Views and columns

EXECUTE

Procedures (Transact-SQL and CLR)

Scalar and aggregate functions (Transact-SQL and CLR)

Synonyms

RECEIVE

Service Broker queues

VIEW DEFINITION

Procedures (Transact-SQL and CLR)

Service Broker queues

Scalar and aggregate functions (Transact-SQL and CLR)

Synonyms

Tables

Table-valued functions (Transact-SQL and CLR)

Views

ALTER

Procedures (Transact-SQL and CLR)

Scalar and aggregate functions (Transact-SQL and CLR)

Service Broker queues

Tables

Table-valued functions (Transact-SQL and CLR)

Views

TAKE OWNERSHIP

Procedures (Transact-SQL and CLR)

Scalar and aggregate functions (Transact-SQL and CLR)

Synonyms

Tables

Table-valued functions (Transact-SQL and CLR)

Views

CONTROL

Procedures (Transact-SQL and CLR)

Scalar and aggregate functions (Transact-SQL and CLR)

Service Broker queues

Synonyms

Tables

Table-valued functions (Transact-SQL and CLR)

Views

SQL Server 2005 Permissions

The following table provides a complete list of the SQL Server 2005 permissions.

Base securable Granular permissions on base securable Permission type code Securable that contains base securable Permission on container securable that implies granular permission on base securable

APPLICATION ROLE

ALTER

AL

DATABASE

ALTER ANY APPLICATION ROLE

APPLICATION ROLE

CONTROL

CL

DATABASE

CONTROL

APPLICATION ROLE

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

ASSEMBLY

ALTER

AL

DATABASE

ALTER ANY ASSEMBLY

ASSEMBLY

CONTROL

CL

DATABASE

CONTROL

ASSEMBLY

EXECUTE

EX

DATABASE

EXECUTE

ASSEMBLY

REFERENCES

RF

DATABASE

REFERENCES

ASSEMBLY

TAKE OWNERSHIP

TO

DATABASE

CONTROL

ASSEMBLY

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

ASYMMETRIC KEY

ALTER

AL

DATABASE

ALTER ANY ASYMMETRIC KEY

ASYMMETRIC KEY

CONTROL

CL

DATABASE

CONTROL

ASYMMETRIC KEY

REFERENCES

RF

DATABASE

REFERENCES

ASYMMETRIC KEY

TAKE OWNERSHIP

TO

DATABASE

CONTROL

ASYMMETRIC KEY

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

CERTIFICATE

ALTER

AL

DATABASE

ALTER ANY CERTIFICATE

CERTIFICATE

CONTROL

CL

DATABASE

CONTROL

CERTIFICATE

REFERENCES

RF

DATABASE

REFERENCES

CERTIFICATE

TAKE OWNERSHIP

TO

DATABASE

CONTROL

CERTIFICATE

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

CONTRACT

ALTER

AL

DATABASE

ALTER ANY CONTRACT

CONTRACT

CONTROL

CL

DATABASE

CONTROL

CONTRACT

REFERENCES

RF

DATABASE

REFERENCES

CONTRACT

TAKE OWNERSHIP

TO

DATABASE

CONTROL

CONTRACT

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

DATABASE

ALTER

AL

SERVER

ALTER ANY DATABASE

DATABASE

ALTER ANY APPLICATION ROLE

ALAR

SERVER

CONTROL SERVER

DATABASE

ALTER ANY ASSEMBLY

ALAS

SERVER

CONTROL SERVER

DATABASE

ALTER ANY ASYMMETRIC KEY

ALAK

SERVER

CONTROL SERVER

DATABASE

ALTER ANY CERTIFICATE

ALCF

SERVER

CONTROL SERVER

DATABASE

ALTER ANY CONTRACT

ALSC

SERVER

CONTROL SERVER

DATABASE

ALTER ANY DATABASE DDL TRIGGER

ALTG

SERVER

CONTROL SERVER

DATABASE

ALTER ANY DATABASE EVENT NOTIFICATION

ALED

SERVER

ALTER ANY EVENT NOTIFICATION

DATABASE

ALTER ANY DATASPACE

ALDS

SERVER

CONTROL SERVER

DATABASE

ALTER ANY FULLTEXT CATALOG

ALFT

SERVER

CONTROL SERVER

DATABASE

ALTER ANY MESSAGE TYPE

ALMT

SERVER

CONTROL SERVER

DATABASE

ALTER ANY REMOTE SERVICE BINDING

ALSB

SERVER

CONTROL SERVER

DATABASE

ALTER ANY ROLE

ALRL

SERVER

CONTROL SERVER

DATABASE

ALTER ANY ROUTE

ALRT

SERVER

CONTROL SERVER

DATABASE

ALTER ANY SCHEMA

ALSM

SERVER

CONTROL SERVER

DATABASE

ALTER ANY SERVICE

ALSV

SERVER

CONTROL SERVER

DATABASE

ALTER ANY SYMMETRIC KEY

ALSK

SERVER

CONTROL SERVER

DATABASE

ALTER ANY USER

ALUS

SERVER

CONTROL SERVER

DATABASE

AUTHENTICATE

AUTH

SERVER

AUTHENTICATE SERVER

DATABASE

BACKUP DATABASE

BADB

SERVER

CONTROL SERVER

DATABASE

BACKUP LOG

BALO

SERVER

CONTROL SERVER

DATABASE

CHECKPOINT

CP

SERVER

CONTROL SERVER

DATABASE

CONNECT

CO

SERVER

CONTROL SERVER

DATABASE

CONNECT REPLICATION

CORP

SERVER

CONTROL SERVER

DATABASE

CONTROL

CL

SERVER

CONTROL SERVER

DATABASE

CREATE AGGREGATE

CRAG

SERVER

CONTROL SERVER

DATABASE

CREATE ASSEMBLY

CRAS

SERVER

CONTROL SERVER

DATABASE

CREATE ASYMMETRIC KEY

CRAK

SERVER

CONTROL SERVER

DATABASE

CREATE CERTIFICATE

CRCF

SERVER

CONTROL SERVER

DATABASE

CREATE CONTRACT

CRSC

SERVER

CONTROL SERVER

DATABASE

CREATE DATABASE

CRDB

SERVER

CREATE ANY DATABASE

DATABASE

CREATE DATABASE DDL EVENT NOTIFICATION

CRED

SERVER

CREATE DDL EVENT NOTIFICATION

DATABASE

CREATE DEFAULT

CRDF

SERVER

CONTROL SERVER

DATABASE

CREATE FULLTEXT CATALOG

CRFT

SERVER

CONTROL SERVER

DATABASE

CREATE FUNCTION

CRFN

SERVER

CONTROL SERVER

DATABASE

CREATE MESSAGE TYPE

CRMT

SERVER

CONTROL SERVER

DATABASE

CREATE PROCEDURE

CRPR

SERVER

CONTROL SERVER

DATABASE

CREATE QUEUE

CRQU

SERVER

CONTROL SERVER

DATABASE

CREATE REMOTE SERVICE BINDING

CRSB

SERVER

CONTROL SERVER

DATABASE

CREATE ROLE

CRRL

SERVER

CONTROL SERVER

DATABASE

CREATE ROUTE

CRRT

SERVER

CONTROL SERVER

DATABASE

CREATE RULE

CRRU

SERVER

CONTROL SERVER

DATABASE

CREATE SCHEMA

CRSM

SERVER

CONTROL SERVER

DATABASE

CREATE SERVICE

CRSV

SERVER

CONTROL SERVER

DATABASE

CREATE SYMMETRIC KEY

CRSK

SERVER

CONTROL SERVER

DATABASE

CREATE SYNONYM

CRSN

SERVER

CONTROL SERVER

DATABASE

CREATE TABLE

CRTB

SERVER

CONTROL SERVER

DATABASE

CREATE TYPE

CRTY

SERVER

CONTROL SERVER

DATABASE

CREATE VIEW

CRVW

SERVER

CONTROL SERVER

DATABASE

CREATE XML SCHEMA COLLECTION

CRXS

SERVER

CONTROL SERVER

DATABASE

DELETE

DL

SERVER

CONTROL SERVER

DATABASE

EXECUTE

EX

SERVER

CONTROL SERVER

DATABASE

INSERT

IN

SERVER

CONTROL SERVER

DATABASE

REFERENCES

RF

SERVER

CONTROL SERVER

DATABASE

SELECT

SL

SERVER

CONTROL SERVER

DATABASE

SHOWPLAN

SPLN

SERVER

ALTER TRACE

DATABASE

SUBSCRIBE QUERY NOTIFICATIONS

SUQN

SERVER

CONTROL SERVER

DATABASE

TAKE OWNERSHIP

TO

SERVER

CONTROL SERVER

DATABASE

UPDATE

UP

SERVER

CONTROL SERVER

DATABASE

VIEW DATABASE STATE

VWDS

SERVER

VIEW SERVER STATE

DATABASE

VIEW DEFINITION

VW

SERVER

VIEW ANY DEFINITION

ENDPOINT

ALTER

AL

SERVER

ALTER ANY ENDPOINT

ENDPOINT

CONNECT

CO

SERVER

CONTROL SERVER

ENDPOINT

CONTROL

CL

SERVER

CONTROL SERVER

ENDPOINT

TAKE OWNERSHIP

TO

SERVER

CONTROL SERVER

ENDPOINT

VIEW DEFINITION

VW

SERVER

VIEW ANY DEFINITION

FULLTEXT CATALOG

ALTER

AL

DATABASE

ALTER ANY FULLTEXT CATALOG

FULLTEXT CATALOG

CONTROL

CL

DATABASE

CONTROL

FULLTEXT CATALOG

REFERENCES

RF

DATABASE

REFERENCES

FULLTEXT CATALOG

TAKE OWNERSHIP

TO

DATABASE

CONTROL

FULLTEXT CATALOG

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

LOGIN

ALTER

AL

SERVER

ALTER ANY LOGIN

LOGIN

CONTROL

CL

SERVER

CONTROL SERVER

LOGIN

IMPERSONATE

IM

SERVER

CONTROL SERVER

LOGIN

VIEW DEFINITION

VW

SERVER

VIEW ANY DEFINITION

MESSAGE TYPE

ALTER

AL

DATABASE

ALTER ANY MESSAGE TYPE

MESSAGE TYPE

CONTROL

CL

DATABASE

CONTROL

MESSAGE TYPE

REFERENCES

RF

DATABASE

REFERENCES

MESSAGE TYPE

TAKE OWNERSHIP

TO

DATABASE

CONTROL

MESSAGE TYPE

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

OBJECT

ALTER

AL

SCHEMA

ALTER

OBJECT

CONTROL

CL

SCHEMA

CONTROL

OBJECT

DELETE

DL

SCHEMA

DELETE

OBJECT

EXECUTE

EX

SCHEMA

EXECUTE

OBJECT

INSERT

IN

SCHEMA

INSERT

OBJECT

RECEIVE

RC

SCHEMA

CONTROL

OBJECT

REFERENCES

RF

SCHEMA

REFERENCES

OBJECT

SELECT

SL

SCHEMA

SELECT

OBJECT

TAKE OWNERSHIP

TO

SCHEMA

CONTROL

OBJECT

UPDATE

UP

SCHEMA

UPDATE

OBJECT

VIEW DEFINITION

VW

SCHEMA

VIEW DEFINITION

REMOTE SERVICE BINDING

ALTER

AL

DATABASE

ALTER ANY REMOTE SERVICE BINDING

REMOTE SERVICE BINDING

CONTROL

CL

DATABASE

CONTROL

REMOTE SERVICE BINDING

TAKE OWNERSHIP

TO

DATABASE

CONTROL

REMOTE SERVICE BINDING

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

ROLE

ALTER

AL

DATABASE

ALTER ANY ROLE

ROLE

CONTROL

CL

DATABASE

CONTROL

ROLE

TAKE OWNERSHIP

TO

DATABASE

CONTROL

ROLE

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

ROUTE

ALTER

AL

DATABASE

ALTER ANY ROUTE

ROUTE

CONTROL

CL

DATABASE

CONTROL

ROUTE

TAKE OWNERSHIP

TO

DATABASE

CONTROL

ROUTE

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

SCHEMA

ALTER

AL

DATABASE

ALTER ANY SCHEMA

SCHEMA

CONTROL

CL

DATABASE

CONTROL

SCHEMA

DELETE

DL

DATABASE

DELETE

SCHEMA

EXECUTE

EX

DATABASE

EXECUTE

SCHEMA

INSERT

IN

DATABASE

INSERT

SCHEMA

REFERENCES

RF

DATABASE

REFERENCES

SCHEMA

SELECT

SL

DATABASE

SELECT

SCHEMA

TAKE OWNERSHIP

TO

DATABASE

CONTROL

SCHEMA

UPDATE

UP

DATABASE

UPDATE

SCHEMA

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

SERVER

ADMINISTER BULK OPERATIONS

ADBO

Not applicable

Not applicable

SERVER

ALTER ANY CONNECTION

ALCO

Not applicable

Not applicable

SERVER

ALTER ANY CREDENTIAL

ALCD

Not applicable

Not applicable

SERVER

ALTER ANY DATABASE

ALDB

Not applicable

Not applicable

SERVER

ALTER ANY ENDPOINT

ALHE

Not applicable

Not applicable

SERVER

ALTER ANY EVENT NOTIFICATION

ALES

Not applicable

Not applicable

SERVER

ALTER ANY LINKED SERVER

ALLS

Not applicable

Not applicable

SERVER

ALTER ANY LOGIN

ALLG

Not applicable

Not applicable

SERVER

ALTER RESOURCES

ALRS

Not applicable

Not applicable

SERVER

ALTER SERVER STATE

ALSS

Not applicable

Not applicable

SERVER

ALTER SETTINGS

ALST

Not applicable

Not applicable

SERVER

ALTER TRACE

ALTR

Not applicable

Not applicable

SERVER

AUTHENTICATE SERVER

AUTH

Not applicable

Not applicable

SERVER

CONNECT SQL

COSQ

Not applicable

Not applicable

SERVER

CONTROL SERVER

CL

Not applicable

Not applicable

SERVER

CREATE ANY DATABASE

CRDB

Not applicable

Not applicable

SERVER

CREATE DDL EVENT NOTIFICATION

CRDE

Not applicable

Not applicable

SERVER

CREATE ENDPOINT

CRHE

Not applicable

Not applicable

SERVER

CREATE TRACE EVENT NOTIFICATION

CRTE

Not applicable

Not applicable

SERVER

EXTERNAL ACCESS ASSEMBLY

XA

Not applicable

Not applicable

SERVER

SHUTDOWN

SHDN

Not applicable

Not applicable

SERVER

UNSAFE ASSEMBLY

XU

Not applicable

Not applicable

SERVER

VIEW ANY DATABASE

VWDB

Not applicable

Not applicable

SERVER

VIEW ANY DEFINITION

VWAD

Not applicable

Not applicable

SERVER

VIEW SERVER STATE

VWSS

Not applicable

Not applicable

SERVICE

ALTER

AL

DATABASE

ALTER ANY SERVICE

SERVICE

CONTROL

CL

DATABASE

CONTROL

SERVICE

SEND

SN

DATABASE

CONTROL

SERVICE

TAKE OWNERSHIP

TO

DATABASE

CONTROL

SERVICE

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

SYMMETRIC KEY

ALTER

AL

DATABASE

ALTER ANY SYMMETRIC KEY

SYMMETRIC KEY

CONTROL

CL

DATABASE

CONTROL

SYMMETRIC KEY

REFERENCES

RF

DATABASE

REFERENCES

SYMMETRIC KEY

TAKE OWNERSHIP

TO

DATABASE

CONTROL

SYMMETRIC KEY

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

TYPE

CONTROL

CL

SCHEMA

CONTROL

TYPE

EXECUTE

EX

SCHEMA

EXECUTE

TYPE

REFERENCES

RF

SCHEMA

REFERENCES

TYPE

TAKE OWNERSHIP

TO

SCHEMA

CONTROL

TYPE

VIEW DEFINITION

VW

SCHEMA

VIEW DEFINITION

USER

ALTER

AL

DATABASE

ALTER ANY USER

USER

CONTROL

CL

DATABASE

CONTROL

USER

IMPERSONATE

IM

DATABASE

CONTROL

USER

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

XML SCHEMA COLLECTION

ALTER

AL

SCHEMA

ALTER

XML SCHEMA COLLECTION

CONTROL

CL

SCHEMA

CONTROL

XML SCHEMA COLLECTION

EXECUTE

EX

SCHEMA

EXECUTE

XML SCHEMA COLLECTION

REFERENCES

RF

SCHEMA

REFERENCES

XML SCHEMA COLLECTION

TAKE OWNERSHIP

TO

SCHEMA

CONTROL

XML SCHEMA COLLECTION

VIEW DEFINITION

VW

SCHEMA

VIEW DEFINITION

APPLICATION ROLE

ALTER

AL

DATABASE

ALTER ANY APPLICATION ROLE

APPLICATION ROLE

CONTROL

CL

DATABASE

CONTROL

APPLICATION ROLE

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

ASSEMBLY

ALTER

AL

DATABASE

ALTER ANY ASSEMBLY

ASSEMBLY

CONTROL

CL

DATABASE

CONTROL

ASSEMBLY

EXECUTE

EX

DATABASE

EXECUTE

ASSEMBLY

REFERENCES

RF

DATABASE

REFERENCES

ASSEMBLY

TAKE OWNERSHIP

TO

DATABASE

CONTROL

ASSEMBLY

VIEW DEFINITION

VW

DATABASE

VIEW DEFINITION

Examples

The following examples show how you can retrieve permissions information.

A. Returning the complete list of grantable permissions

SELECT * FROM fn_builtin_permissions(default);
GO

B. Returning the permissions on a particular class of objects

The following example returns permissions on assemblies.

SELECT * FROM fn_builtin_permissions('assembly');
GO  

C. Returning the permissions granted to the executing principal on an object

The following example returns permissions on an object named Orders55.

SELECT * FROM fn_my_permissions('Orders55', 'object');
GO

D. Returning the permissions applicable to a specified object

The following example returns permissions applicable to an object called Yttrium. Note that the built-in function OBJECT_ID is used to retrieve the ID of object Yttrium.

SELECT * FROM sys.database_permissions 
    WHERE major_id = OBJECT_ID('Yttrium');
GO

See Also

Concepts

Permissions of Fixed Database Roles
Permissions of Fixed Server Roles
Securables

Other Resources

sys.fn_builtin_permissions (Transact-SQL)
sys.database_permissions (Transact-SQL)
sys.database_principals (Transact-SQL)
sys.database_role_members (Transact-SQL)
sys.server_permissions (Transact-SQL)
sys.server_principals (Transact-SQL)
sys.server_role_members (Transact-SQL)
sys.sql_logins (Transact-SQL)
sys.certificates (Transact-SQL)
sys.symmetric_keys (Transact-SQL)
sys.asymmetric_keys (Transact-SQL)
sys.key_encryptions (Transact-SQL)
sys.crypt_properties (Transact-SQL)
sys.credentials (Transact-SQL)
OBJECT_ID (Transact-SQL)

Help and Information

Getting SQL Server 2005 Assistance