How make user or role specific triggers in AZURE DW or Azure synapse?

Viewed 442

Is there any way to make user or role specific triggers in Azure Synapse or azure DW?

1 Answers

You do not need a trigger for this. Users can only do what you allow them to do. For example, when you first create a user in the database, they have no permissions. Users can only drop tables if they are members of the database role db_ddladmin or they are effectively db_owner or sysadmins. So the answer to your question is, make sure that user is not a member of the db_ddladmin role in the database.

You can look at using the DENY statement for certain roles but I think that would lead to an over-complicated setup that is hard to maintain and administer. See the Database Roles documentation for Synapse for more info.

Related