Returns
privilege information for all columns in a table or view.
Syntax
sp_table_privileges table_name [, table_owner[, table_qualifier]]
Parameters
- table_name – is the name of the table. The use of wildcard characters
in pattern matching is not supported.
- table_owner – is the name of the table owner. The use of wildcard
characters in pattern matching is not supported. If you do not specify
the table owner, sp_table_privileges looks
for a table owned by the current user and then for a table owned
by the Database Owner.
- table_qualifier – is the name of the database. This can be either
the current database or NULL.
Usage
The results set for sp_table_privileges is:
Column
|
Datatype
|
Description
|
table_qualifier
|
varchar(32)
|
The name of the database. This field
can be NULL.
|
table_owner
|
varchar(32)
|
|
table_name
|
varchar(32)
|
NOT NULL.
|
grantor
|
varchar(32)
|
NOT NULL.
|
grantee
|
varchar(32)
|
NOT NULL.
|
privilege
|
varchar(32)
|
Identifies the table privilege. May be
one of the following: SELECT – The
grantee is permitted to retrieve data for one or more columns of the
table.
INSERT – The grantee is permitted to insert
rows containing data.
UPDATE – The grantee is permitted to update
the data in one or more columns of the table.
DELETE – The grantee is permitted to delete
rows of data from the table.
REFERENCE – The grantee is permitted to
refer to one or more columns of the table within a constraint.
|
is_grantable
|
varchar(3)
|
Indicates whether the grantee is permitted
to grant the privilege to other users. The values are YES, NO, and
NULL.
|
Permissions
Any
user can execute sp_table_privileges.