Grants database object-level privileges on individual tables or views
to a user or role.
Syntax
GRANT object-level-privilege [, …]
ON [ <owner>.]<object-name>
TO <userID [,...]>
[ WITH GRANT OPTION ]
object-level-privilege
ALL [ PRIVILEGES ]
| ALTER
| DELETE
| INSERT
| LOAD
| REFERENCE [ ( <column-name> [, …] ) ]
| SELECT [ ( <column-name> [, …] ) ]
| TRUNCATE
| UPDATE [ ( <column-name>, …) ] }
Parameters
(back to top)
- userID must be the name of an existing user or
immutable role. The list must consist of existing users with login
passwords. Separate the userIDs in the list with commas.
- ALL grants all privileges to users
- ALTER users can alter this table with the
ALTER TABLE statement. This privilege is not allowed for
views.
- DELETE users can delete rows from this table or
view.
- INSERT users can insert rows into the named table or
view.
- LOAD users can load data into the named table or
view.
- REFERENCES users can create indexes on the named tables,
and foreign keys that reference the named tables. If column names are specified,
then users can reference only those columns. REFERENCES privileges on columns cannot
be granted for views, only for tables.
- SELECT users can look at information in this view or
table. If column names are specified, then the users can look at only those columns.
SELECT permissions on columns cannot be granted for views, only for tables.
- TRUNCATE users can truncate the named table or
view.
- UPDATE users can update rows in this view or table. If
column names are specified, users can update only those columns. UPDATE privileges
on columns cannot be granted for views, only for tables. To update a table, users
must have both SELECT and UPDATE privilege on the table.
- WITH GRANT OPTION the named user ID is also given privileges to
grant the same privileges to other user IDs.
Usage
(back to top)
You can list the table privileges, or specify ALL to grant all
privileges at once.
Standards
(back to top)
- SQL–Syntax is an entry-level feature.
- SAP Database products–Syntax is supported in
SAP ASE.
Permissions
(back to top)
Requires one of:
- MANAGE ANY OBJECT PRIVILEGE system privilege
- You have been granted the specific object privilege with the
WITH GRANT OPTION clause on the table.
- You own of the table.