Collection Contents Index Granting DBA and RESOURCE authority Next PDF

SQL Anywhere® Server - Database Administration  > Managing User IDs and Permissions  > Managing individual user IDs and permissions

Granting permissions on tables


You can assign a set of permissions on individual tables and grant users combinations of these permissions to define their access to a table.

You can use either Sybase Central or Interactive SQL to set permissions. In Interactive SQL, you can use the GRANT statement to grant the following permissions on tables:

To grant permissions on tables or columns (Sybase Central)
  1. Connect to the database.

  2. Open the Tables folder for that database.

  3. Select a table and then choose File > Properties.

  4. On the Permissions tab of the Table property sheet, configure the permissions for the table:

Tips

You can also assign permissions from the User or Group property sheet. To assign permissions to many users and groups at once, use the table's property sheet. To assign permissions to many tables at once, use the User property sheet.

To grant permissions on tables or columns (SQL)
  1. Connect to the database as the DBA or as the owner of the table.

  2. Execute a GRANT statement to assign the permission.

    See GRANT statement.

  3. Example 1

    All table permissions are granted in a very similar fashion. You can grant permission to M_Haneef to delete rows from the table named sample_table as follows:

    1. Connect to the database as the DBA, or as the owner of sample_table.

    2. Execute the following SQL statement:

      GRANT DELETE
      ON sample_table
      TO M_Haneef;
    Example 2

    You can grant permission to M_Haneef to update the column_1 and column_2 columns only in the table named sample_table as follows:

    1. Connect to the database as the DBA, or as the owner of sample_table.

    2. Execute the following SQL statement:

      GRANT UPDATE (column_1, column_2)
      ON sample_table
      TO M_Haneef;

    Table permissions are limited in that they generally apply to all the data in a table, although the REFERENCES, SELECT, and UPDATE permissions can be granted to a subset of columns. You can fine-tune user permissions by creating procedures that perform actions on tables, and then granting users the permission to execute the procedure.

    See also

    Collection Contents Index Granting DBA and RESOURCE authority Next PDF