Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » User and database security » User security (roles and privileges) » Privileges

 

Granting an object-level privilege (SQL)

Grant object-level privileges to allow access to a specific object, such as a table, view, procedure, sequence, or dbspace. You can view and change privileges either per user, role, or database object.

Prerequisites

To grant an object-level privilege, one of the following must be true:

  • You are the owner of the database object you are granting privileges for.

  • You have been granted the privilege and have administrative rights on it.

  • You have the MANAGE ANY OBJECT PRIVILEGE system privilege.

Context and remarks

When you grant privileges to roles, they are inherited by the members of the role.

 Task
  1. Connect to the database.

  2. Execute a GRANT statement.

Results

The user is granted the specified object-level privilege.

Example

The following statement grants SELECT privilege on table myTable to user AnnW:

GRANT SELECT ON myTable TO AnnW;

The following statement grants SELECT privilege on table myTable to user AnnW, and gives her administrative rights for the privilege:

GRANT SELECT ON myTable TO AnnW WITH GRANT OPTION;

 See also