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:

  • The ALTER permission allows a user to alter the structure of a table or to create triggers on a table. The REFERENCES permission allows a user to create indexes on a table and to create foreign keys. These permissions grant the authority to modify the database schema, and so will not be assigned to most users. These permissions do not apply to views.

  • The DELETE, INSERT, and UPDATE permissions grant the authority to modify the data in a table.

  • The SELECT permission grants authority to look at data in a table, but does not give permission to change it.

  • The ALL permission grants all the above permissions.

  • The REFERENCES, SELECT, and UPDATE permissions can be restricted to a set of columns in the table or view.

 To grant permissions on tables or columns (Sybase Central)
  1. Use the SQL Anywhere 12 plug-in to connect to the database as a user with DBA authority.

  2. Click Tables.

  3. Right-click a table and then choose Properties.

  4. Click the Permissions tab and configure the permissions for the table:

    • Click Grant.

    • Double-click a user or group.

    • In the permissions table, click the fields beside the user or group to set specific permissions.

    • Select a user and click Change to set specific permissions for a columns.

    • Click OK.

    • To revoke all permissions, select a user or group and click Revoke.

  5. Click Apply.

Tips

You can also assign permissions from the User Properties or Group Properties window. To assign permissions to multiple users or groups, use the Table Properties window. To assign permissions to multiple tables, use the User Properties window.

 To grant permissions on tables or columns (SQL)
  1. Connect to the database as a user with DBA authority.

  2. Execute a GRANT statement to assign the permission.

    See GRANT statement.

 Example 1
 Example 2
 See also