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) » Tutorial: Granting roles and privileges (SQL)

 

Lesson 2: Grant privileges to UserA (SQL)

Grant system privileges and object-level privileges to UserA.

Prérequis

This lesson assumes that you have completed all previous lessons in this tutorial. See Lesson 1: Create two users: UserA and UserB (SQL).

 Task
  1. In Interactive SQL, execute the following statement to grant the BACKUP DATABASE and VALIDATE ANY OBJECT system privileges to UserA:

    GRANT BACKUP DATABASE, VALIDATE ANY OBJECT TO UserA;
  2. Execute the following statement to grant SELECT and UPDATE object-level privileges on the Employees table to UserA, with administration rights:

    GRANT SELECT, UPDATE ON GROUPO.EMPLOYEES TO UserA WITH GRANT OPTION;
  3. This allows UserA to select from, and update, the Employees table. UserA can also grant the ability to select and update from the Employees table to other users.

Résultat

UserA now has the BACKUP DATABASE and VALIDATE ANY OBJECT system privileges, which are required to back up the sample database. UserA also has the SELECT and UPDATE object-level privileges on the Employees table, and can grant the same privileges to other users.

 See also