Manage database privileges; object scope, roles and syntax differ across engines.
GRANT SELECT ON reporting_view TO analyst_role;Manage database privileges; object scope, roles and syntax differ across engines.
GRANT privilege ON object TO principal;
REVOKE privilege ON object FROM principal;Manage database privileges; object scope, roles and syntax differ across engines.
GRANT SELECT ON reporting_view TO analyst_role;SQLite-oriented example; consult the relevant dialect manual.
GRANT SELECT ON reporting_view TO analyst_role;| Option / clause | Description |
|---|---|
Principal | Specify the user, role or other database principal. |
Privilege | Choose permissions such as SELECT, INSERT, UPDATE or EXECUTE. |
ON object | Set the database object or scope to which a privilege applies. |
TO / FROM | Name a grantee for GRANT or a principal for REVOKE. |
WITH GRANT OPTION | Allow onward grants where the database supports it. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.