| Goal | Privilege User Needs |
|---|---|
| Create macro | CREATE MACRO privilege on the database or user in which the macro is to be created. The creator automatically gets the DROP MACRO and EXECUTE privileges WITH GRANT OPTION. The immediate owner of the macro is the containing database of the macro, not the user who created the macro. The immediate owner determines the macro access privileges, not the macro. The immediate owner must have all the appropriate privileges for executing the macro, including WITH GRANT OPTION. |
| Drop macro | DROP MACRO privilege on the macro. |
| Rename macro | DROP MACRO privilege on the macro. In addition, the user renaming a macro must have the privileges for all statements the macro performs. |
| Run macro | EXECUTE privilege on the macro. In addition, the immediate owner of the macro (the database in which the macro resides) must have the necessary privileges on objects named in the request set for statements that are contained in the macro. |
| Replace macro |
After a macro has been replaced, its immediate owner is its containing database, not the user who replaced it. The immediately owning database must have all the appropriate privileges for executing the macro, including WITH GRANT OPTION.
|
| Delete macro | DROP MACRO privilege on the specified macro |