Granting Role

Database
Enthusiast

Granting Role

How to grant

Grant BMW_AC_DEV role Create Table and Drop Table access to : A_Z_STAG_A.BMW3_BMWSTMT 
 B_Z_DATA_A.G4W3_G4WSTMT

 

1 REPLY
Teradata Employee

Re: Granting Role

You can't grant CREATE TABLE on a specific table, that right can only be granted on the owner database. Do you really need DROP / CREATE or would simply allowing the role members to DELETE all the data be sufficient?

 

GRANT CREATE TABLE ON A_Z_STAG_A TO BMW_AC_DEV;
GRANT CREATE TABLE ON B_Z_DATA_A TO BMW_AC_DEV;

GRANT DROP TABLE ON A_Z_STAG_A.BMW3_BMWSTMT TO BMW_AC_DEV;
GRANT DROP TABLE ON B_Z_DATA_A.G4W3_G4WSTMT TO BMW_AC_DEV;

 

If you really need to restrict the access to Drop / re-Create of a single table, consider creating a stored procedure to do that and granting EXECUTE PROCEDURE to the role.